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
animationThe animation that updated its range.
startDateThe start date of the animation time range.
endDateThe 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
animationThe animation that started playing.
startDateThe 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
animationThe animation that stopped playing.
stopDateThe 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
animationThe animation that paused.
dateThe 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
animationThe animation whose date was updated.
currentDateThe 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
animationThe 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
animationThe 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
animationThe animation that started loading.
totalThe 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
animationThe animation that failed to perform the request
dataThe request data parameters used with the request
errorThe 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
animationThe animation whose loading progress changed.
progressThe total number of requests completed.
totalThe 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
animationThe 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
animationThe animation whose loading progress failed
errorThe 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
animationThe animation that cancelled the loading process.
totalThe 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
animationThe animatoin that was reset.
View on GitHub
AWFAnimationDelegate Protocol Reference