When a button is pressed I want to segue between two view controllers by using a Modal Transition style CoverVertical
and then dismiss it. There is allot of info ou
Its pretty easy :
to dismiss a modal view with swift 3.0 : Use dismiss Api like below :
> @IBAction func dismissClick(_ sender: Any) {
> dismiss(animated: true, completion: nil)
>
> }
For present :
> @IBAction func dismissClick(_ sender: Any) {
> present(UIViewController(), animated: true, completion: nil)
>
> }
For more details here you go :
https://developer.apple.com/documentation/uikit/uiviewcontroller#//apple_ref/doc/uid/TP40006926-CH3-SW96
You can use presentViewController:animated:completion:
and dismissViewControllerAnimated:completion:
methods from UIViewController
. See docs here
To Dismiss View Controller in Swift 3.0
self.dismiss(animated: true, completion: {})
Dismiss view controller in Swift 4:
dismiss(animated: true, completion: nil)
Swift 5:
present(UIViewController(), animated: true, completion: nil)
dismiss(animated: true, completion: nil)
Swift 2.2:
self.presentViewController(true, completion: nil)
Hide/dismiss a view controller:
self.dismissViewControllerAnimated(true, completion: nil)