TNImage

public struct TNImage : View

Undocumented

  • Undocumented

    Declaration

    Swift

    @ObservedObject
    public var imageLoader: ImageLoader { get set }
  • Main body

    Declaration

    Swift

    public var body: some View { get }
  • Download a remote image with the specified url.

    Declaration

    Swift

    public init(with url: String,
                configuration: TNConfiguration? = nil,
                defaultImage: TNImageType? = nil,
                resize: CGSize? = nil,
                preprocessImage: ImagePreprocessType? = nil,
                onFinish: ImageOnFinishCallbackType? = nil)

    Parameters

    url

    The url of the image.

    configuration

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

    defaultImage

    A UIImage|NSImage 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

    onFinish

    A block of code to execute after the completion of the request. If the request fails, an error will be returned

  • Download a remote image with the specified url.

    Declaration

    Swift

    public init(with request: TNRequest,
                defaultImage: TNImageType? = nil,
                resize: CGSize? = nil,
                preprocessImage: ImagePreprocessType? = nil,
                onFinish: ImageOnFinishCallbackType? = nil)

    Parameters

    request

    A TNRequest instance.

    configuration

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

    defaultImage

    A UIImage|NSImage 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)