Megaetron Megaetron - 1 year ago 103
Swift Question

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

In android you can call the method

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

Answer Source

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.