FLAnimatedImageView(WebCache)

@interface FLAnimatedImageView (WebCache)

A category for the FLAnimatedImage imageView class that hooks it to the SDWebImage system. Very similar to the base class category (UIImageView (WebCache))

  • Load the image at the given url (either from cache or download) and load it in this imageView. It works with both static and dynamic images The download is asynchronous and cached.

    Declaration

    Objective-C

    - (void)sd_setImageWithURL:(nullable NSURL *)url;

    Swift

    func __sd_setImage(with url: URL?)

    Parameters

    url

    The url for the image.

  • Load the image at the given url (either from cache or download) and load it in this imageView. It works with both static and dynamic images The download is asynchronous and cached. Uses a placeholder until the request finishes.

    Declaration

    Objective-C

    - (void)sd_setImageWithURL:(nullable NSURL *)url
              placeholderImage:(nullable UIImage *)placeholder;

    Swift

    func __sd_setImage(with url: URL?, placeholderImage placeholder: UIImage?)

    Parameters

    url

    The url for the image.

    placeholder

    The image to be set initially, until the image request finishes.

  • Load the image at the given url (either from cache or download) and load it in this imageView. It works with both static and dynamic images The download is asynchronous and cached. Uses a placeholder until the request finishes.

    Declaration

    Objective-C

    - (void)sd_setImageWithURL:(nullable NSURL *)url
              placeholderImage:(nullable UIImage *)placeholder
                       options:(SDWebImageOptions)options;

    Swift

    func __sd_setImage(with url: URL?, placeholderImage placeholder: UIImage?, options: SDWebImageOptions = [])

    Parameters

    url

    The url for the image.

    placeholder

    The image to be set initially, until the image request finishes.

    options

    The options to use when downloading the image. - see: SDWebImageOptions for the possible values.

  • Set the imageView image with an url, placeholder, custom options and context.

    The download is asynchronous and cached.

    Declaration

    Objective-C

    - (void)sd_setImageWithURL:(nullable NSURL *)url
              placeholderImage:(nullable UIImage *)placeholder
                       options:(SDWebImageOptions)options
                       context:(nullable SDWebImageContext *)context;

    Swift

    func sd_setImage(with url: URL?, placeholderImage placeholder: UIImage?, options: SDWebImageOptions = [], context: [SDWebImageContextOption : Any]?)

    Parameters

    url

    The url for the image.

    placeholder

    The image to be set initially, until the image request finishes.

    options

    The options to use when downloading the image. - see: SDWebImageOptions for the possible values.

    context

    A context contains different options to perform specify changes or processes, see SDWebImageContextOption. This hold the extra objects which options enum can not hold.

  • Load the image at the given url (either from cache or download) and load it in this imageView. It works with both static and dynamic images The download is asynchronous and cached.

    Declaration

    Objective-C

    - (void)sd_setImageWithURL:(nullable NSURL *)url
                     completed:(nullable SDExternalCompletionBlock)completedBlock;

    Swift

    func sd_setImage(with url: URL?, completed completedBlock: SDExternalCompletionBlock? = nil)

    Parameters

    url

    The url for the image.

    completedBlock

    A block called when operation has been completed. This block has no return value and takes the requested UIImage as first parameter. In case of error the image parameter is nil and the second parameter may contain an NSError. The third parameter is a Boolean indicating if the image was retrieved from the local cache or from the network. The fourth parameter is the original image url.

  • Load the image at the given url (either from cache or download) and load it in this imageView. It works with both static and dynamic images The download is asynchronous and cached. Uses a placeholder until the request finishes.

    Declaration

    Objective-C

    - (void)sd_setImageWithURL:(nullable NSURL *)url
              placeholderImage:(nullable UIImage *)placeholder
                     completed:(nullable SDExternalCompletionBlock)completedBlock;

    Swift

    func __sd_setImage(with url: URL?, placeholderImage placeholder: UIImage?, completed completedBlock: SDExternalCompletionBlock? = nil)

    Parameters

    url

    The url for the image.

    placeholder

    The image to be set initially, until the image request finishes.

    completedBlock

    A block called when operation has been completed. This block has no return value and takes the requested UIImage as first parameter. In case of error the image parameter is nil and the second parameter may contain an NSError. The third parameter is a Boolean indicating if the image was retrieved from the local cache or from the network. The fourth parameter is the original image url.

  • Load the image at the given url (either from cache or download) and load it in this imageView. It works with both static and dynamic images The download is asynchronous and cached. Uses a placeholder until the request finishes.

    Declaration

    Objective-C

    - (void)sd_setImageWithURL:(nullable NSURL *)url
              placeholderImage:(nullable UIImage *)placeholder
                       options:(SDWebImageOptions)options
                     completed:(nullable SDExternalCompletionBlock)completedBlock;

    Swift

    func sd_setImage(with url: URL?, placeholderImage placeholder: UIImage?, options: SDWebImageOptions = [], completed completedBlock: SDExternalCompletionBlock? = nil)

    Parameters

    url

    The url for the image.

    placeholder

    The image to be set initially, until the image request finishes.

    options

    The options to use when downloading the image. - see: SDWebImageOptions for the possible values.

    completedBlock

    A block called when operation has been completed. This block has no return value and takes the requested UIImage as first parameter. In case of error the image parameter is nil and the second parameter may contain an NSError. The third parameter is a Boolean indicating if the image was retrieved from the local cache or from the network. The fourth parameter is the original image url.

  • Load the image at the given url (either from cache or download) and load it in this imageView. It works with both static and dynamic images The download is asynchronous and cached. Uses a placeholder until the request finishes.

    Declaration

    Objective-C

    - (void)sd_setImageWithURL:(nullable NSURL *)url
              placeholderImage:(nullable UIImage *)placeholder
                       options:(SDWebImageOptions)options
                      progress:(nullable SDImageLoaderProgressBlock)progressBlock
                     completed:(nullable SDExternalCompletionBlock)completedBlock;

    Swift

    func sd_setImage(with url: URL?, placeholderImage placeholder: UIImage?, options: SDWebImageOptions = [], progress progressBlock: SDImageLoaderProgressBlock?, completed completedBlock: SDExternalCompletionBlock? = nil)

    Parameters

    url

    The url for the image.

    placeholder

    The image to be set initially, until the image request finishes.

    options

    The options to use when downloading the image. - see: SDWebImageOptions for the possible values.

    progressBlock

    A block called while image is downloading - note: the progress block is executed on a background queue

    completedBlock

    A block called when operation has been completed. This block has no return value and takes the requested UIImage as first parameter. In case of error the image parameter is nil and the second parameter may contain an NSError. The third parameter is a Boolean indicating if the image was retrieved from the local cache or from the network. The fourth parameter is the original image url.

  • Set the imageView image with an url, placeholder, custom options and context.

    The download is asynchronous and cached.

    Declaration

    Objective-C

    - (void)sd_setImageWithURL:(nullable NSURL *)url
              placeholderImage:(nullable UIImage *)placeholder
                       options:(SDWebImageOptions)options
                       context:(nullable SDWebImageContext *)context
                      progress:(nullable SDImageLoaderProgressBlock)progressBlock
                     completed:(nullable SDExternalCompletionBlock)completedBlock;

    Swift

    func sd_setImage(with url: URL?, placeholderImage placeholder: UIImage?, options: SDWebImageOptions = [], context: [SDWebImageContextOption : Any]?, progress progressBlock: SDImageLoaderProgressBlock?, completed completedBlock: SDExternalCompletionBlock? = nil)

    Parameters

    url

    The url for the image.

    placeholder

    The image to be set initially, until the image request finishes.

    options

    The options to use when downloading the image. - see: SDWebImageOptions for the possible values.

    context

    A context contains different options to perform specify changes or processes, see SDWebImageContextOption. This hold the extra objects which options enum can not hold.

    progressBlock

    A block called while image is downloading - note: the progress block is executed on a background queue

    completedBlock

    A block called when operation has been completed. This block has no return value and takes the requested UIImage as first parameter. In case of error the image parameter is nil and the second parameter may contain an NSError. The third parameter is a Boolean indicating if the image was retrieved from the local cache or from the network. The fourth parameter is the original image url.