Megaetron Megaetron - 1 month ago 16
Swift Question

Is there a function to finish a UIviewcontroller like in android?

In android you can call the method

finish()
and the activity closes. Is there something similar in swift?

Answer

Not quite. In iOS land you have to more explicitly call viewController.dismissViewControllerAnimated(true, completion: nil) if your view controller is a modal or one of the various dismissal methods on UINavigationController if your viewController was pushed on to the screen.

Comments