Initializer

init(url:)

Creates an image object from the image at the specified URL.

Declaration

convenience init?(url URL: URL)

Parameters

URL

A URL that specifies an image file on a remote server. The image file can be in any format supported by the system, but it is recommended that you use PNG images.

Return Value

A new image object or nil if the specified image data was invalid.

See Also

Creating an Image Object

init(named: String)

Creates an image object whose contents are taken from the specified name.

init(uiImage: UIImage)

Creates an image object from an existing UIKit image.

init(cgImage: CGImage)

Creates an image object from an existing Core Graphics image.

init(imageData: Data)

Creates an image object using the specified data.

init?(url: URL, width: Double, height: Double)

Creates an image object from the data at the specified URL and sizes it to the desired width and height.