In this recipe, we will look at how we can apply transition animations to views as well as each of the available transitions that come with storyboards.
You may have seen such transitions in applications, such as the photos app that comes as part of the iPhone and iPad, where you can apply a transition and start a slideshow.
In order to configure a segue to specify a kind of transition to use between the different scenes, perform the following simple steps:
You have the ability to choose from the various transition types that are only applicable to the Modal style; these are explained within the following table:
These transitions come as part of the UIViewController
class that inherits from the UIKit
framework. The UIViewController
class provides the underlying fundamental view-management model for all of your iOS apps.
For more information on the preceding transition types, refer to the UIViewController
framework reference in the Apple Developer documentation, located at https://developer.apple.com/library/ios/#documentation/uikit/reference/UIViewController_Class/Reference/Reference.html.
Xcode provides the option of changing the visual appearance of the transition as it takes place from one scene to another within a storyboard. These are commonly referred to as segues.
Using transitions enables you to apply a variety of different styles to each of your view controllers that are to be rendered and displayed to the view, and are represented by arrows between each of the view controllers. By default, a Cover Vertical transition is performed whereby the new scene slides vertically upwards from the bottom of the view to cover the currently displayed scene.
You have the ability to define custom transitions that enable you to provide a custom segue class method to handle the transition. This can be achieved by selecting custom for the style of a segue, and fill in the name of the custom segue class to use. If you want to use any of the standard segue classes, you can find these located within the UIKit
class.
For information on the standard segue classes, you can refer to the UIKitframework
reference in the Apple Developer documentation, located at https://developer.apple.com/library/ios/#documentation/uikit/reference/UIKit_Framework/_index.html.