Using UIView's several animation aspects can make the animation more simple
1. If the view properties changes, use the following methods
+ (void) Animatewithduration: (nstimeinterval) Duration delay: (nstimeinterval) Delay options: (uiviewanimationoptions) Options Animations: (void(^) (void)) Animations Completion: (void(^) (BOOL finished)) completion; + (void) Animatewithduration: (nstimeinterval) Duration animations: (void(^) (void)) Animations Completion: (void(^) (BOOL finished)) completion; + (void) Animatewithduration: (nstimeinterval) Duration animations: (void(^) (void)) animations;+ (void) Animatewithduration: (nstimeinterval) Duration delay: (nstimeinterval) Delay usingspringwithdamping: (cgfloat) Dampingratio initialspringvelocity: (cgfloat) Velocity options: (uiviewanimationoptions) Options animations: (void(^) (void)) Animations Completion: (void(^) (BOOL finished)) completion;
Properties that can be used as animation are: Frame,bounds,center,alpha, transform (settransform), Bkgcolor
If the options have the repeat option, how do you stop the animation?
Available [Self.layer removeallanimations]; stop animation
More control, setting camediatiming properties (refer to http://www.cnblogs.com/gaoxiao228/archive/2013/01/28/2880285.html)
2. If the hierachy of the view changes, use the following methods:
+ (void) Transitionwithview: (UIView *) View Duration: (nstimeinterval) Duration options: ( uiviewanimationoptions) Options animations: (void (^) (void)) Animations completion: (void ( ^) (BOOL finished)) completion; + (void) Transitionfromview: (UIView *) Fromview Toview: (UIView *) Toview Duration: (nstimeinterval) duration Options: (uiviewanimationoptions) Options completion: (void (^// Toview added to Fromview.superview, Fromview removed from its superview
iOS Development Summary (A0)-UIView Animation