1.UIDynamicAnimator的初始化
- (instancetype)initWithReferenceView:(UIView *)view;
view參數(shù):是一個(gè)參照視圖己莺,表示物理仿真的范圍
2.UIDynamicAnimator的常見(jiàn)方法
//添加1個(gè)物理仿真行為
- (void)addBehavior:(UIDynamicBehavior *)behavior;
// 移除1個(gè)物理仿真行為
- (void)removeBehavior:(UIDynamicBehavior *)behavior;
// 移除之前添加過(guò)的所有物理仿真行為
- (void)removeAllBehaviors;
3.UIDynamicAnimator的常見(jiàn)屬性
// 參照視圖
@property (nonatomic,
readonly) UIView* referenceView;
// 添加到物理仿真器中的所有物理仿真行為
@property (nonatomic, readonly, copy) NSArray* behaviors;
// 是否正在進(jìn)行物理仿真
@property (nonatomic, readonly, getter = isRunning) BOOL running;
// 代理對(duì)象(能監(jiān)聽(tīng)物理仿真器的仿真過(guò)程情竹,比如開(kāi)始和結(jié)束)
@property (nonatomic, assign) id <UIDynamicAnimatorDelegate> delegate;