SDWebImagePrefetcherDelegate

@protocol SDWebImagePrefetcherDelegate <NSObject>

The prefetcher delegate protocol

  • Called when an image was prefetched. Which means it’s called when one URL from any of prefetching finished.

    Declaration

    Objective-C

    - (void)imagePrefetcher:(nonnull SDWebImagePrefetcher *)imagePrefetcher
             didPrefetchURL:(nullable NSURL *)imageURL
              finishedCount:(NSUInteger)finishedCount
                 totalCount:(NSUInteger)totalCount;

    Swift

    optional func imagePrefetcher(_ imagePrefetcher: SDWebImagePrefetcher, didPrefetchURL imageURL: URL?, finishedCount: UInt, totalCount: UInt)

    Parameters

    imagePrefetcher

    The current image prefetcher

    imageURL

    The image url that was prefetched

    finishedCount

    The total number of images that were prefetched (successful or not)

    totalCount

    The total number of images that were to be prefetched

  • Called when all images are prefetched. Which means it’s called when all URLs from all of prefetching finished.

    Declaration

    Objective-C

    - (void)imagePrefetcher:(nonnull SDWebImagePrefetcher *)imagePrefetcher
        didFinishWithTotalCount:(NSUInteger)totalCount
                   skippedCount:(NSUInteger)skippedCount;

    Swift

    optional func imagePrefetcher(_ imagePrefetcher: SDWebImagePrefetcher, didFinishWithTotalCount totalCount: UInt, skippedCount: UInt)

    Parameters

    imagePrefetcher

    The current image prefetcher

    totalCount

    The total number of images that were prefetched (whether successful or not)

    skippedCount

    The total number of images that were skipped