In Core Animation framework, why the methods beginAnimations:context: and commitAnimations are class methods of UIView?
Why not being instance methods so we code:
[widget beginAnimations:@""];
[widget commitAnimations];
instead of:
[UIView beginAnimations:@"" context:widget];
[UIView commitAnimations];
The
beginAnimations:context:class method begins an animation “block”:With the above snippet,
view1andview2will animate the changes inside that block.The
contextproperty is NOT the view you want to animate, just information that can be accessed via the delegate methods.http://developer.apple.com/library/ios/#documentation/uikit/reference/UIView_Class/UIView/UIView.html
As a sidenote, this way of performing animations is discouraged in iOS4 and above. If you need to target older iOS versions, check the flag: