Image
@available(iOS 13.0, *)
public struct Image : View
Image is a SwiftUI component for downloading images.
-
Main body
Declaration
Swift
public var body: some View { get } -
Download a remote image with the specified url.
Declaration
Swift
public init(url: String, configuration: Configuration? = nil, defaultImage: ImageType? = nil, resizeTo size: CGSize? = nil, preprocessImage: ImagePreprocessType? = nil, onFinish: ImageOnFinishCallbackType? = nil)Parameters
urlThe url of the image.
configurationA Configuration object that will be used to make the request.
defaultImageA UIImage|NSImage to show before the is downloaded (optional)
resizeToResizes the image to the given CGSize
preprocessImageA block of code that preprocesses the after the download. This block will run in the background thread
onFinishA 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(request: Request, defaultImage: ImageType? = nil, resizeTo size: CGSize? = nil, preprocessImage: ImagePreprocessType? = nil, onFinish: ImageOnFinishCallbackType? = nil)Parameters
requestA Request instance.
configurationA Configuration object that will be used to make the request.
defaultImageA UIImage|NSImage to show before the is downloaded (optional)
resizeToResizes the image to the given CGSize
preprocessImageA block of code that preprocesses the after the download. This block will run in the background thread (optional)
View on GitHub
Install in Dash
Image Structure Reference