Type Method

imageWithURL:width:height:

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

Declaration

+ (instancetype)imageWithURL:(NSURL *)URL width:(double)width height:(double)height;

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.

width

The width (measured in points) to use for the image. The image is scaled horizontally, as needed, to fit the specified size.

height

The height (measured in points) to use for the image. The image is scaled vertically, as needed, to fit the specified size.

Return Value

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

See Also

Creating an Image Object

+ imageNamed:

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

+ imageWithUIImage:

Creates an image object from an existing UIKit image.

+ imageWithCGImage:

Creates an image object from an existing Core Graphics image.

+ imageWithURL:

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

+ imageWithImageData:

Creates an image object using the specified data.