Display and dismiss a modal view controller in Swift
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)
To Dismiss View Controller in Swift 3.0
self.dismiss(animated: true, completion: {})