Implementing a custom modal presentation transition

A lot of applications implement modally-presented view controllers. A modally-presented view controller is typically a view controller that is presented on top of the current screen as an overlay. By default, modally-presented view controllers animate upward from the bottom of the screen and are often used to present forms or other temporary content to the user. In this section, you'll take a look at the default modal presentation transition and how to customize it to suit your own needs.

The first thing you should do is create a view controller that will be presented modally. Start by creating a new Cocoa Touch Class and name it CustomPresentedViewController. Make sure that it subclasses ...

Get Mastering iOS 12 Programming - Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.