AWFAnimationDataSource

Objective-C

@protocol AWFAnimationDataSource <NSObject>

Swift

protocol AWFAnimationDataSource : NSObjectProtocol

The AWFAnimationDataSource protocol is adopted by an object that provides basic information that is needed for an animation object.

  • Asks the data source what property to use for each item in the data set for assigning its date position. (optional)

    Declaration

    Objective-C

    - (nonnull NSString *)modelPropertyToUseForDateAssignment:
        (nonnull AWFAnimation *)animation;

    Swift

    optional func modelPropertyToUse(forDateAssignment animation: AWFAnimation) -> String

    Parameters

    animation

    The animation object requesting the data.

    Return Value

    The property name to use for assigning each item’s date position.

  • Asks the data source if the animation should request new data for the specified coordinate bounds.

    Declaration

    Objective-C

    - (BOOL)animation:(nonnull AWFAnimation *)animation
        shouldLoadDataForBounds:(nonnull AWFMapCoordinateBounds *)bounds;

    Swift

    optional func animation(_ animation: AWFAnimation, shouldLoadDataFor bounds: AWFMapCoordinateBounds) -> Bool

    Parameters

    animation

    The animation object requesting the information.

    bounds

    The coordinate bounds to be used for the request.

    Return Value

    YES if the animation should request data for the bounds, otherwise NO.

  • Tells the delegate when the animation object cancelled its data loading process.

    Declaration

    Objective-C

    - (void)cancelLoadingDataForAnimation:(nonnull AWFAnimation *)animation;

    Swift

    optional func cancelLoadingData(for animation: AWFAnimation)

    Parameters

    animation

    The animation object that cancelled loading.

  • Asks the data source for the total number of requests being made for the current loading process.

    This value is the sum of both completed and queued requests and is not an indicator of the number of requests currently remaining before the animation is ready for playback.

    Declaration

    Objective-C

    - (NSInteger)totalRequestsForAnimation:(nonnull AWFAnimation *)animation;

    Swift

    optional func totalRequests(for animation: AWFAnimation) -> Int

    Parameters

    animation

    The animation object requesting the information.

    Return Value

    The total number of requests needed before the animation is ready for playback.

  • Asks the data source for the total number of requests remaining for the current loading process.

    Declaration

    Objective-C

    - (NSInteger)totalRequestsRemainingForAnimation:
        (nonnull AWFAnimation *)animation;

    Swift

    optional func totalRequestsRemaining(for animation: AWFAnimation) -> Int

    Parameters

    animation

    The animation object requesting the information.

    Return Value

    The total number of requests remaining before the animation is ready for playback.

  • Tells the data source that the animation data needs to be invalidated.

    This is usually called when the animation is reset to its original state and new data needs to be reloaded.

    Declaration

    Objective-C

    - (void)invalidateDataForAnimation:(nonnull AWFAnimation *)animation;

    Swift

    optional func invalidateData(for animation: AWFAnimation)

    Parameters

    animation

    The animation object that needs to be invalidated.