Change images and resources dynamically when the screen gamut on your device changes.
On Apple TV (5th generation), the assets required for an app depend on the screen gamut of the TV being used, with 4K TVs using the Display P3 gamut, and all other resolutions using the sRGB gamut. Also, the screen gamut of the TV can change at any time, switching between 4K and other resolutions. Your app needs to respond to these changes and present the appropriate assets when required.
Create and Place the Image Assets
In Xcode, create an image asset in an asset catalog. In the Attributes inspector, configure the asset catalog to handle Display P3 images. In the Devices pane, ensure that Apple TV is selected. From the Gamut menu, select sRGB and Display P3. Figure 1 shows the correct settings.
Add Images to the Asset Catalog
Place non-4K images in the 1x (sRGB) slot and 4K images in the 2x (Display P3) slot. The correct image is automatically loaded based on the display gamut of the TV. Figure 2 shows assets placed in their correct containers.
Adapt to Screen Changes Programmatically
trait method to respond to changing device traits. If your app performs expensive operations related to image generation based on the current display gamut, it's important to verify that the display gamut has changed before performing these operations. Listing 1 shows how to test whether the display gamut changed.