Instance Method

initWithImage:highlightedImage:

Returns an image view initialized with the specified regular and highlighted images.

Declaration

- (instancetype)initWithImage:(UIImage *)image highlightedImage:(UIImage *)highlightedImage;

Parameters

image

The initial image to display in the image view. You may specify an image object that contains an animated sequence of images.

highlightedImage

The image to display when the image view is highlighted. You may specify an image object that contains an animated sequence of images.

Return Value

An initialized image view object.

Discussion

The images you specify are used to configure the initial size of the image view itself. Use constraints and the image view’s content mode to adjust the image view’s final size onscreen. This method disables user interactions for the image view by setting the userInteractionEnabled property to NO.

If you specify an animated image whose duration is greater than 0, the image view automatically starts playing the animation.

See Also

Creating an Image View

- initWithImage:

Returns an image view initialized with the specified image.