一丶原文
#import <pop/POPAnimatableProperty.h>
#import <pop/POPAnimation.h>
/**
@abstract Flags for clamping animation values.
@discussion Animation values can optionally be clamped to avoid overshoot. kPOPAnimationClampStart ensures values are more than fromValue and kPOPAnimationClampEnd ensures values are less than toValue.
*/
typedef NS_OPTIONS(NSUInteger, POPAnimationClampFlags)
{
kPOPAnimationClampNone = 0,
kPOPAnimationClampStart = 1UL << 0,
kPOPAnimationClampEnd = 1UL << 1,
kPOPAnimationClampBoth = kPOPAnimationClampStart | kPOPAnimationClampEnd,
};
/**
semi-concrete 屬性動畫子類
*/
@interface POPPropertyAnimation : POPAnimation
/**
做動畫的屬性
*/
@property (strong, nonatomic) POPAnimatableProperty *property;
/**
做動畫的初始值;
如果未設置,則在動畫啟動的時候,按照對象當前的值作為初始值;
*/
@property (copy, nonatomic) id fromValue;
/**
做動畫的值
如果未設置,則在動畫啟動的時候,按照對象當前的值作為初始值;
*/
@property (copy, nonatomic) id toValue;
/**
四舍五入系數(shù);
作用讓動畫變得更圓滑; 默認0; 取1.0和取整值之間;
*/
@property (assign, nonatomic) CGFloat roundingFactor;
/**
就是讓動畫保證在fromValue和tovalue之間,不會越界;
*/
@property (assign, nonatomic) NSUInteger clampMode;
/**
動畫的值是疊加,而不是設置;
默認NO;
*/
@property (assign, nonatomic, getter = isAdditive) BOOL additive;
@end
二問題
1.@property (assign, nonatomic) CGFloat roundingFactor; 使用;
先看看源碼;
默認為0
roundingFactor(0),
繼續(xù)翻
四舍五入;
就是讓每一幀動畫變得更滑一點;
@property (assign, nonatomic) NSUInteger clampMode;
慶幸是開源的,不然壓根不懂它干嘛的;
讓動畫保證在fromValue和tovalue之間,不會越界
看枚舉
kPOPAnimationClampNone = 0,
kPOPAnimationClampStart = 1UL << 0, //保證fromValue開始
kPOPAnimationClampEnd = 1UL << 1,//保證toValue開始
kPOPAnimationClampBoth = kPOPAnimationClampStart | kPOPAnimationClampEnd,
@property (assign, nonatomic, getter = isAdditive) BOOL additive;
疊加,不是設置;
圖片來源:http://www.tuicool.com/articles/v22QVfq
三丶其他:
翻譯有問題,留言告訴我下,謝謝;
以及有使用問題也可以留言,一起探討探討;