AWFAnimationDelegate
Objective-C
@protocol AWFAnimationDelegate <NSObject>
Swift
protocol AWFAnimationDelegate : NSObjectProtocol
The AWFAnimationDelegate
protocol defines a set of optional methods that can be used to receive animation-related update
messages. These methods notify your application of changes to the state of the animation, such as when playback starts or
stops.
-
Tells the delegate the animation updated its start/end time range.
Declaration
Objective-C
- (void)animation:(nonnull AWFAnimation *)animation didUpdateStartDate:(nonnull NSDate *)startDate endDate:(nonnull NSDate *)endDate;
Swift
optional func animation(_ animation: AWFAnimation, didUpdateStart startDate: Date, end endDate: Date)
Parameters
animation
The animation that updated its range.
startDate
The start date of the animation time range.
endDate
The end date of the animation time range.
-
Tells the delegate the animation started playback.
Declaration
Objective-C
- (void)animation:(nonnull AWFAnimation *)animation didStartAtDate:(nonnull NSDate *)startDate;
Swift
optional func animation(_ animation: AWFAnimation, didStartAt startDate: Date)
Parameters
animation
The animation that started playing.
startDate
The date from which the animation started.
-
Tells the delegate the animation ended playback.
Declaration
Objective-C
- (void)animation:(nonnull AWFAnimation *)animation didStopAtDate:(nonnull NSDate *)stopDate;
Swift
optional func animation(_ animation: AWFAnimation, didStopAt stopDate: Date)
Parameters
animation
The animation that stopped playing.
stopDate
The date at which the animation stopped.
-
Tells the delegate the animation paused playback.
Declaration
Objective-C
- (void)animation:(nonnull AWFAnimation *)animation didPauseAtDate:(nonnull NSDate *)date;
Swift
optional func animation(_ animation: AWFAnimation, didPauseAt date: Date)
Parameters
animation
The animation that paused.
date
The date at which the animation was paused.
-
Tells the delegate the animation did update to a specific date along its timeline.
Declaration
Objective-C
- (void)animation:(nonnull AWFAnimation *)animation didUpdateToDate:(nonnull NSDate *)currentDate;
Swift
optional func animation(_ animation: AWFAnimation, didUpdateTo currentDate: Date)
Parameters
animation
The animation whose date was updated.
currentDate
The date the animation updated to along its timeline.
-
Tells the delegate the animation is ready for playback. This is often used for animations that require loading remote data before playing.
See
AWFImageAnimation, AWFDataAnimationDeclaration
Objective-C
- (void)animationIsReady:(nonnull AWFAnimation *)animation;
Swift
optional func animationIsReady(_ animation: AWFAnimation)
Parameters
animation
The animation that is ready.
-
Tells the delegate the animation restarted playing from the beginning of its timeline.
Declaration
Objective-C
- (void)animationDidRestart:(nonnull AWFAnimation *)animation;
Swift
optional func animationDidRestart(_ animation: AWFAnimation)
Parameters
animation
The animation that restarted.
-
Tells the delegate the animation started loading remote data required for playback.
Declaration
Objective-C
- (void)animationDidStartLoading:(nonnull AWFAnimation *)animation total:(NSInteger)total;
Swift
optional func animationDidStartLoading(_ animation: AWFAnimation, total: Int)
Parameters
animation
The animation that started loading.
total
The total number of data requests required for the animation.
-
Tells the delegate the animation failed to perform a request required for the animation using the provided parameters.
Declaration
Objective-C
- (void)animation:(nonnull AWFAnimation *)animation didFailToPerformRequestForData:(nonnull NSDictionary *)data error:(nonnull NSError *)error;
Swift
optional func animation(_ animation: AWFAnimation, didFailToPerformRequestForData data: [AnyHashable : Any], error: Error)
Parameters
animation
The animation that failed to perform the request
data
The request data parameters used with the request
error
The error that occurred
-
Tells the delegate the loading progress for the animation changed.
Declaration
Objective-C
- (void)animation:(nonnull AWFAnimation *)animation didUpdateLoadingProgress:(NSInteger)progress total:(NSInteger)total error:(nullable NSError *)error;
Swift
optional func animation(_ animation: AWFAnimation, didUpdateLoadingProgress progress: Int, total: Int, error: Error?)
Parameters
animation
The animation whose loading progress changed.
progress
The total number of requests completed.
total
The total number of requests required.
-
Tells the delegate the loading progress for the animation has completed.
Declaration
Objective-C
- (void)animationDidFinishLoading:(nonnull AWFAnimation *)animation;
Swift
optional func animationDidFinishLoading(_ animation: AWFAnimation)
Parameters
animation
The animation whose loading progress completed.
-
Tells the delegate the loading process failed.
Declaration
Objective-C
- (void)animation:(nonnull AWFAnimation *)animation didFailLoadingWithError:(nonnull NSError *)error;
Swift
optional func animation(_ animation: AWFAnimation, didFailLoadingWithError error: Error)
Parameters
animation
The animation whose loading progress failed
error
The error that occurred
-
Tells the delegate the loading progress was cancelled and is no longer requesting data.
Declaration
Objective-C
- (void)animationDidCancelLoading:(nonnull AWFAnimation *)animation totalCancelledRequests:(NSInteger)total;
Swift
optional func animationDidCancelLoading(_ animation: AWFAnimation, totalCancelledRequests total: Int)
Parameters
animation
The animation that cancelled the loading process.
total
The total number of remaining requests that were cancelled.
-
Tells the delegate the animation has been reset.
When an animation is reset, it is returned to its original state. All data that may have been previously loaded was purged and will need to be reloaded again before the animation can begin playing again.
Declaration
Objective-C
- (void)animationDidReset:(nonnull AWFAnimation *)animation;
Swift
optional func animationDidReset(_ animation: AWFAnimation)
Parameters
animation
The animatoin that was reset.