| Conforms to | |
| Framework | /System/Library/Frameworks/AppKit.framework |
| Availability | Available in Mac OS X v10.6 and later. |
| Declared in | NSAnimation.h |
| Companion guides | |
| Related sample code |
The NSAnimationDelegate protocol defines the optional methods implemented by delegates of NSAnimation objects.
Sent to the delegate when an animation reaches a specific progress mark.
- (void)animation:(NSAnimation *)animation didReachProgressMark:(NSAnimationProgress)progress
A running NSAnimation object that has reached a progress mark.
A float value (typed as NSAnimationProgress) that indicates a progress mark of animation.
The delegate typically implements this method to perform some animation effect for the time slice indicated by progress, such as redrawing objects in a view with new coordinates or changing the frame location or size of a window or view. As an alternative to this delegation message, you may choose to observe the NSAnimationProgressMarkNotification notification.
NSAnimation.hRequests a custom curve value for the current progress value.
- (float)animation:(NSAnimation *)animation valueForProgress:(NSAnimationProgress)progress
An NSAnimation object that is running.
A float value (typed as NSAnimationProgress) that indicates a progress mark of animation. This value is always between 0.0 and 1.0.
A float value representing a custom curve.
The delegate can compute and return a custom curve value for the given progress value. If the delegate does not implement this method, NSAnimation computes the current curve value.
The animation:valueForProgress: message is sent to the delegate when an NSAnimation object receives a currentValue message. The value the delegate returns is used as the value of currentValue; if there is no delegate, or it doesn't implement animation:valueForProgress:, NSAnimation computes and returns the current value. NSAnimation does not invoke currentValueitself, but subclasses might.
See the description of currentValue for more information.
– currentValue (NSAnimation)NSAnimation.hSent to the delegate when the specified animation completes its run.
- (void)animationDidEnd:(NSAnimation *)animation
The NSAnimation instance that completed its run.
When an NSAnimation object reaches the end of its planned duration, it has a progress value of 1.0.
NSAnimation.hSent to the delegate when the specified animation is stopped before it completes its run.
- (void)animationDidStop:(NSAnimation *)animation
The NSAnimation instance that was stopped.
An NSAnimation object stops running when it receives a stopAnimation message.
NSAnimation.hSent to the delegate just after an animation is started.
- (BOOL)animationShouldStart:(NSAnimation *)animation
The NSAnimation object that was just started.
NO to cancel the animation, YES to have the animation proceed.
The delegate is sent this message just after animation receives a startAnimation message. The delegate can use this method to prepare objects and resources for the effect.
NSAnimation.hLast updated: 2009-04-15