UIImageView

extension UIImageView
  • Download a remote image with the specified url.

    Declaration

    Swift

    public func tn_setRemoteImage(url: String,
                                  configuration: TNConfiguration? = nil,
                                  defaultImage: UIImage? = nil,
                                  resize: CGSize? = nil,
                                  preprocessImage: ImagePreprocessType? = nil,
                                  onFinish: ImageOnFinishType? = nil) throws

    Parameters

    url

    The url of the image.

    configuration

    A TNConfiguration object that will be used to make the request.

    defaultImage

    A UIImage to show before the is downloaded (optional)

    resize

    Resizes the image to the given CGSize

    preprocessImage

    A block of code that preprocesses the after the download. This block will run in the background thread (optional)

    onFinish

    A block of code to execute after the completion of the download image request. If the request fails, an error will be returned (optional)

  • Download a remote image with the specified url.

    Declaration

    Swift

    public func tn_setRemoteImage(request: TNRequest,
                                  defaultImage: UIImage? = nil,
                                  resize: CGSize? = nil,
                                  preprocessImage: ImagePreprocessType? = nil,
                                  onFinish: ImageOnFinishType? = nil) throws

    Parameters

    request

    A TNRequest instance.

    defaultImage

    A UIImage to show before the is downloaded (optional)

    resize

    Resizes the image to the given CGSize

    preprocessImage

    A block of code that preprocesses the after the download. This block will run in the background thread (optional)

    onFinish

    A block of code to execute after the completion of the download image request. If the request fails, an error will be returned (optional)