So far in this chapter we’ve looked at two of Apple’s
application templates. However, in this section we’re going to focus
once again on an individual view controller—or rather, a way to
present a view controller to the user. After table
views and the
it’s probably one of the most heavily used ways to present data: it’s the
modal view controller.
You’ll have seen a modal controller in action many times when using your iPhone. A view slides in from the bottom of the screen and is usually dismissed with a Done button at the top of the screen. When dismissed, it slides back down the screen, disappearing at the bottom.
In the main controller we would generally have a button or other UI element; tapping this would trigger an event linked to the following method in the view controller, which would bring up the modal view: