1。类似重力引起的自由落体行为
2。UIDynamicAnimator
初始化:- (instancetype) initWithReferenceView : (UIView *) view ;
3。UIGravityBehavior
初始化:- (instancetype) initWithItems : (NSArray *) items ; //items : 想要进行自由落体的对象
4。add behavior to the animator
- (void) addBehavior : (UIDynamicBehavior *) behavior ;
e.g.
UIView *gravityView = [ [ UIView alloc ] initWithFrame : CGRectMake (0.0f, 0.0f, 100.0f, 100.0f ) ] ;
gravityView.center = self.view.center ;
[ self.view addSubview : gravityView ] ;
UIDynamicAnimator *myAnimator = [ [ UIDynamicAnimator alloc ] initWithReferenceView : self.view ] ;
UIGravityBehavior *myGravity = [ [ UIGravityBehavior alloc ] initWithItems : @[ gravityView ] ] ;
[ myAnimator addBehavior : myGravity ] ;
p.s. ios7及以上有效