Contents

setImageURL(_:for:)

Associates an image with the current item.

Declaration

func setImageURL(_ imageURL: URL?, for traits: TVTopShelfItem.ImageTraits)

Parameters

  • imageURL:

    The URL of the image. Specify nil to remove the image with the specified traits from the item.

  • traits:

    The traits that describe the image.

Discussion

Use this method to assign images to a top shelf item. For most items, the system displays only an image. For carousel items, the system initially displays an image, but switches to the preview video when the navigation focus stops on the item.

The system always chooses the image whose traits match the target device.

See Also

Providing an Image for the Item