before IOS7, there are 4 main switches for View controller:
1. Push/pop,navigationviewcontroller
2. Present and Dismis Modal
3. Uitabbarcontroller
4. Addchildviewcontroller (typically used to customize the container subclass that inherits from Uiviewcontroller)
IOS5, call-(void) Transitionfromviewcontroller: (Uiviewcontroller *) Fromviewcontroller Toviewcontroller: ( Uiviewcontroller *) Toviewcontroller Duration: (nstimeinterval) Duration options: (uiviewanimationoptions) options Animations: (void (^) (void)) animations completion: (void (^) (BOOL finished)) Completion Ns_available_ios (5_0);
(1) The previous 3 methods here is not much to say, very common system method. As for the fourth kind, I have already made the exposition in the previous article-Analysis NetEase tab bar effect, but it provides the container transition animation only can realize some simple uiview animation, but is difficult to reuse, the coupling is high.
(2) Key APIs:
A. The animation controller (Animation Controllers) complies with the Uiviewcontrolleranimatedtransitioning protocol and is responsible for the actual execution of the animation.
B. The interactive controller (Interaction Controllers) controls an interactive transition by complying with the Uiviewcontrollerinteractivetransitioning protocol.
C. The transition agent (transitioning Delegates) provides the required animation controller and interactive controller conveniently according to the different transition types.
which 2 new methods are added to the Uinavigationcontrollerdelegate delegate for Navigationcontroller
uiviewcontrollertransitioningdelegate New transitioningdelegate to Modal's present and Dismis
D. The transition context (transitioning contexts) defines the metadata that is required for the transition, such as the associated properties of the view Controller and view involved in the transition process. The transition context object complies with the Uiviewcontrollercontexttransitioning protocol and is generated and provided by the system.
E. The transition Coordinator (Transition coordinators) can run other animations in parallel while the transition animation is running. The transition coordinator complies with the Uiviewcontrollertransitioncoordinator protocol.
(3) The new API mainly provides 2 ways of VC switching:
A. Non-interactive switching, that is, the definition of a VC from one to another VC animation effect, when switching to automatically play,
B. Interactive switch, this way also need to define the animation effect, but the animation effect will be based on following interactive gestures to switch the VC and play the animation effect. IOS7 provides a default percentage-based animation implementation uipercentdriveninteractivetransition, and according to WWDC's instructions, the simplest way to implement interactive animations is through inheritance Uipercentdriveninteractivetransition.
@ To be continued ..... The following chapter shows the actual demo
IOS7 new features viewcontroller transition switch (i) Previous summary and key API introduction