-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix property 'positiveFormat' / 'negativeFormat' not found on object of type 'NSFormatter *' by adding casts to NSNumberFormatter Set version to 1.5.1 Remove obsolete 1.4.1 zip file and add the 1.5.1 for easy downloading
- Loading branch information
Showing
94 changed files
with
2,463 additions
and
1,283 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
@class CPTAnimationOperation; | ||
@class CPTAnimationPeriod; | ||
|
||
/** | ||
* @brief Enumeration of animation curves. | ||
**/ | ||
typedef enum _CPTAnimationCurve { | ||
CPTAnimationCurveDefault, ///< Use the default animation curve. | ||
CPTAnimationCurveLinear, ///< Linear animation curve. | ||
CPTAnimationCurveBackIn, ///< Backing in animation curve. | ||
CPTAnimationCurveBackOut, ///< Backing out animation curve. | ||
CPTAnimationCurveBackInOut, ///< Backing in and out animation curve. | ||
CPTAnimationCurveBounceIn, ///< Bounce in animation curve. | ||
CPTAnimationCurveBounceOut, ///< Bounce out animation curve. | ||
CPTAnimationCurveBounceInOut, ///< Bounce in and out animation curve. | ||
CPTAnimationCurveCircularIn, ///< Circular in animation curve. | ||
CPTAnimationCurveCircularOut, ///< Circular out animation curve. | ||
CPTAnimationCurveCircularInOut, ///< Circular in and out animation curve. | ||
CPTAnimationCurveElasticIn, ///< Elastic in animation curve. | ||
CPTAnimationCurveElasticOut, ///< Elastic out animation curve. | ||
CPTAnimationCurveElasticInOut, ///< Elastic in and out animation curve. | ||
CPTAnimationCurveExponentialIn, ///< Exponential in animation curve. | ||
CPTAnimationCurveExponentialOut, ///< Exponential out animation curve. | ||
CPTAnimationCurveExponentialInOut, ///< Exponential in and out animation curve. | ||
CPTAnimationCurveSinusoidalIn, ///< Sinusoidal in animation curve. | ||
CPTAnimationCurveSinusoidalOut, ///< Sinusoidal out animation curve. | ||
CPTAnimationCurveSinusoidalInOut, ///< Sinusoidal in and out animation curve. | ||
CPTAnimationCurveCubicIn, ///< Cubic in animation curve. | ||
CPTAnimationCurveCubicOut, ///< Cubic out animation curve. | ||
CPTAnimationCurveCubicInOut, ///< Cubic in and out animation curve. | ||
CPTAnimationCurveQuadraticIn, ///< Quadratic in animation curve. | ||
CPTAnimationCurveQuadraticOut, ///< Quadratic out animation curve. | ||
CPTAnimationCurveQuadraticInOut, ///< Quadratic in and out animation curve. | ||
CPTAnimationCurveQuarticIn, ///< Quartic in animation curve. | ||
CPTAnimationCurveQuarticOut, ///< Quartic out animation curve. | ||
CPTAnimationCurveQuarticInOut, ///< Quartic in and out animation curve. | ||
CPTAnimationCurveQuinticIn, ///< Quintic in animation curve. | ||
CPTAnimationCurveQuinticOut, ///< Quintic out animation curve. | ||
CPTAnimationCurveQuinticInOut ///< Quintic in and out animation curve. | ||
} | ||
CPTAnimationCurve; | ||
|
||
/** | ||
* @brief Animation delegate. | ||
**/ | ||
@protocol CPTAnimationDelegate<NSObject> | ||
|
||
@optional | ||
|
||
/// @name Animation | ||
/// @{ | ||
|
||
/** @brief @optional Informs the delegate that an animation operation started animating. | ||
* @param operation The animation operation. | ||
**/ | ||
-(void)animationDidStart:(CPTAnimationOperation *)operation; | ||
|
||
/** @brief @optional Informs the delegate that an animation operation stopped after reaching its full duration. | ||
* @param operation The animation operation. | ||
**/ | ||
-(void)animationDidFinish:(CPTAnimationOperation *)operation; | ||
|
||
/** @brief @optional Informs the delegate that an animation operation was stopped before reaching its full duration. | ||
* @param operation The animation operation. | ||
**/ | ||
-(void)animationCancelled:(CPTAnimationOperation *)operation; | ||
|
||
/** @brief @optional Informs the delegate that the animated property is about to update. | ||
* @param operation The animation operation. | ||
**/ | ||
-(void)animationWillUpdate:(CPTAnimationOperation *)operation; | ||
|
||
/** @brief @optional Informs the delegate that the animated property has been updated. | ||
* @param operation The animation operation. | ||
**/ | ||
-(void)animationDidUpdate:(CPTAnimationOperation *)operation; | ||
|
||
/// @} | ||
|
||
@end | ||
|
||
#pragma mark - | ||
|
||
@interface CPTAnimation : NSObject | ||
{ | ||
@private | ||
NSMutableArray *animationOperations; | ||
NSMutableArray *runningAnimationOperations; | ||
NSMutableArray *expiredAnimationOperations; | ||
NSTimer *timer; | ||
|
||
CGFloat timeOffset; | ||
CPTAnimationCurve defaultAnimationCurve; | ||
} | ||
|
||
/// @name Time | ||
/// @{ | ||
@property (nonatomic, readonly, assign) CGFloat timeOffset; | ||
/// @} | ||
|
||
/// @name Animation Curve | ||
/// @{ | ||
@property (nonatomic, assign) CPTAnimationCurve defaultAnimationCurve; | ||
/// @} | ||
|
||
/// @name Animation Controller Instance | ||
/// @{ | ||
+(CPTAnimation *)sharedInstance; | ||
/// @} | ||
|
||
/// @name Property Animation | ||
/// @{ | ||
+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property period:(CPTAnimationPeriod *)period animationCurve:(CPTAnimationCurve)animationCurve delegate:(NSObject<CPTAnimationDelegate> *)delegate; | ||
/// @} | ||
|
||
/// @name Animation Management | ||
/// @{ | ||
-(CPTAnimationOperation *)addAnimationOperation:(CPTAnimationOperation *)animationOperation; | ||
-(void)removeAnimationOperation:(CPTAnimationOperation *)animationOperation; | ||
-(void)removeAllAnimationOperations; | ||
/// @} | ||
|
||
/// @name Retrieving Animation Operations | ||
/// @{ | ||
-(CPTAnimationOperation *)operationWithIdentifier:(id<NSCopying, NSObject>)identifier; | ||
/// @} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#import "CPTAnimation.h" | ||
#import "CPTDefinitions.h" | ||
|
||
@class CPTAnimationPeriod; | ||
|
||
@interface CPTAnimationOperation : NSObject { | ||
@private | ||
CPTAnimationPeriod *period; | ||
CPTAnimationCurve animationCurve; | ||
|
||
id boundObject; | ||
SEL boundGetter; | ||
SEL boundSetter; | ||
|
||
__cpt_weak NSObject<CPTAnimationDelegate> *delegate; | ||
id<NSCopying, NSObject> identifier; | ||
NSDictionary *userInfo; | ||
} | ||
|
||
/// @name Animation Timing | ||
/// @{ | ||
@property (nonatomic, retain) CPTAnimationPeriod *period; | ||
@property (nonatomic, assign) CPTAnimationCurve animationCurve; | ||
/// @} | ||
|
||
/// @name Animated Property | ||
/// @{ | ||
@property (nonatomic, retain) id boundObject; | ||
@property (nonatomic) SEL boundGetter; | ||
@property (nonatomic) SEL boundSetter; | ||
/// @} | ||
|
||
/// @name Delegate | ||
/// @{ | ||
@property (nonatomic, cpt_weak_property) __cpt_weak NSObject<CPTAnimationDelegate> *delegate; | ||
/// @} | ||
|
||
/// @name Identification | ||
/// @{ | ||
@property (nonatomic, readwrite, copy) id<NSCopying, NSObject> identifier; | ||
@property (nonatomic, readwrite, copy) NSDictionary *userInfo; | ||
/// @} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
#import "CPTAnimation.h" | ||
|
||
@class CPTAnimationOperation; | ||
@class CPTPlotRange; | ||
|
||
@interface CPTAnimationPeriod : NSObject { | ||
@private | ||
NSValue *startValue; | ||
NSValue *endValue; | ||
CGFloat duration; | ||
CGFloat delay; | ||
CGFloat startOffset; | ||
} | ||
|
||
/// @name Timing Values | ||
/// @{ | ||
@property (nonatomic, readwrite, copy) NSValue *startValue; | ||
@property (nonatomic, readwrite, copy) NSValue *endValue; | ||
@property (nonatomic, readwrite) CGFloat duration; | ||
@property (nonatomic, readwrite) CGFloat delay; | ||
@property (nonatomic, readonly) CGFloat startOffset; | ||
/// @} | ||
|
||
/// @name Factory Methods | ||
/// @{ | ||
+(id)periodWithStart:(CGFloat)aStart end:(CGFloat)anEnd duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; | ||
+(id)periodWithStartPoint:(CGPoint)aStartPoint endPoint:(CGPoint)anEndPoint duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; | ||
+(id)periodWithStartSize:(CGSize)aStartSize endSize:(CGSize)anEndSize duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; | ||
+(id)periodWithStartRect:(CGRect)aStartRect endRect:(CGRect)anEndRect duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; | ||
+(id)periodWithStartDecimal:(NSDecimal)aStartDecimal endDecimal:(NSDecimal)anEndDecimal duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; | ||
+(id)periodWithStartPlotRange:(CPTPlotRange *)aStartPlotRange endPlotRange:(CPTPlotRange *)anEndPlotRange duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; | ||
/// @} | ||
|
||
/// @name Initialization | ||
/// @{ | ||
-(id)initWithStart:(CGFloat)aStart end:(CGFloat)anEnd duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; | ||
-(id)initWithStartPoint:(CGPoint)aStartPoint endPoint:(CGPoint)anEndPoint duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; | ||
-(id)initWithStartSize:(CGSize)aStartSize endSize:(CGSize)anEndSize duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; | ||
-(id)initWithStartRect:(CGRect)aStartRect endRect:(CGRect)anEndRect duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; | ||
-(id)initWithStartDecimal:(NSDecimal)aStartDecimal endDecimal:(NSDecimal)anEndDecimal duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; | ||
-(id)initWithStartPlotRange:(CPTPlotRange *)aStartPlotRange endPlotRange:(CPTPlotRange *)anEndPlotRange duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; | ||
/// @} | ||
|
||
@end | ||
|
||
#pragma mark - | ||
|
||
/** @category CPTAnimationPeriod(AbstractMethods) | ||
* @brief CPTAnimationPeriod abstract methods—must be overridden by subclasses | ||
**/ | ||
@interface CPTAnimationPeriod(AbstractMethods) | ||
|
||
/// @name Initialization | ||
/// @{ | ||
-(void)setStartValueFromObject:(id)boundObject propertyGetter:(SEL)boundGetter; | ||
/// @} | ||
|
||
/// @name Interpolation | ||
/// @{ | ||
-(NSValue *)tweenedValueForProgress:(CGFloat)progress; | ||
/// @} | ||
|
||
/// @name Comparison | ||
/// @{ | ||
-(BOOL)canStartWithValueFromObject:(id)boundObject propertyGetter:(SEL)boundGetter; | ||
/// @} | ||
|
||
@end | ||
|
||
#pragma mark - | ||
|
||
@interface CPTAnimation(CPTAnimationPeriodAdditions) | ||
|
||
/// @name CGFloat Property Animation | ||
/// @{ | ||
+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property from:(CGFloat)from to:(CGFloat)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(NSObject<CPTAnimationDelegate> *)delegate; | ||
+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property from:(CGFloat)from to:(CGFloat)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(NSObject<CPTAnimationDelegate> *)delegate; | ||
+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property from:(CGFloat)from to:(CGFloat)to duration:(CGFloat)duration; | ||
/// @} | ||
|
||
/// @name CGPoint Property Animation | ||
/// @{ | ||
+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromPoint:(CGPoint)from toPoint:(CGPoint)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(NSObject<CPTAnimationDelegate> *)delegate; | ||
+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromPoint:(CGPoint)from toPoint:(CGPoint)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(NSObject<CPTAnimationDelegate> *)delegate; | ||
+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromPoint:(CGPoint)from toPoint:(CGPoint)to duration:(CGFloat)duration; | ||
/// @} | ||
|
||
/// @name CGSize Property Animation | ||
/// @{ | ||
+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromSize:(CGSize)from toSize:(CGSize)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(NSObject<CPTAnimationDelegate> *)delegate; | ||
+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromSize:(CGSize)from toSize:(CGSize)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(NSObject<CPTAnimationDelegate> *)delegate; | ||
+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromSize:(CGSize)from toSize:(CGSize)to duration:(CGFloat)duration; | ||
/// @} | ||
|
||
/// @name CGRect Property Animation | ||
/// @{ | ||
+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromRect:(CGRect)from toRect:(CGRect)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(NSObject<CPTAnimationDelegate> *)delegate; | ||
+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromRect:(CGRect)from toRect:(CGRect)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(NSObject<CPTAnimationDelegate> *)delegate; | ||
+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromRect:(CGRect)from toRect:(CGRect)to duration:(CGFloat)duration; | ||
/// @} | ||
|
||
/// @name NSDecimal Property Animation | ||
/// @{ | ||
+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromDecimal:(NSDecimal)from toDecimal:(NSDecimal)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(NSObject<CPTAnimationDelegate> *)delegate; | ||
+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromDecimal:(NSDecimal)from toDecimal:(NSDecimal)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(NSObject<CPTAnimationDelegate> *)delegate; | ||
+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromDecimal:(NSDecimal)from toDecimal:(NSDecimal)to duration:(CGFloat)duration; | ||
/// @} | ||
|
||
/// @name CPTPlotRange Property Animation | ||
/// @{ | ||
+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromPlotRange:(CPTPlotRange *)from toPlotRange:(CPTPlotRange *)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(NSObject<CPTAnimationDelegate> *)delegate; | ||
+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromPlotRange:(CPTPlotRange *)from toPlotRange:(CPTPlotRange *)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(NSObject<CPTAnimationDelegate> *)delegate; | ||
+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromPlotRange:(CPTPlotRange *)from toPlotRange:(CPTPlotRange *)to duration:(CGFloat)duration; | ||
/// @} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.