Presenting Modal UIViewControllers
Sometimes we want one controller to take up the entire screen to get a user’s attention. For example, Mailapp’s New Message screen appears on top of the usual inbox list, forcing the user to either complete the message or explicitly end the task. To accomplish this, we present the controller modally.
UIViewControllers allows us to present modal view controllers at any point in their life cycle. The key method is presentViewController:animated:completion:, which functions similarly to UINavigationController’s pushViewController:animated:. The given controller will be presented above all other controllers in the app and will remain there until we invoke dismissViewControllerAnimated:completion:.
Let’s present ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access