<!--
{
  "availability" : [
    "tvOS: 11.0.0 - 13.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "TVServices",
  "identifier" : "/documentation/TVServices/TVContentItem/imageURL(forTraits:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "TV Services"
    ],
    "preciseIdentifier" : "c:objc(cs)TVContentItem(im)imageURLForTraits:"
  },
  "title" : "imageURL(forTraits:)"
}
-->

# imageURL(forTraits:)

Retrieve the URL for the image that best matches the specified traits.

```
func imageURL(forTraits traits: TVContentItemImageTrait) -> URL?
```

## Parameters

`traits`

The traits for the image you want. For example, you might ask specifically for the variant of the image that supports a dark interface.

## Return Value

The URL for the image asset, or `nil` if an image with the specified traits was not found.

## Discussion

The image URL can be an absolute path on the local device or an HTTP path. The preferred file format for this image is a layered image file that provides the proper 3d effects. For more information, see [App Programming Guide for tvOS](https://developer.apple.com/library/archive/documentation/General/Conceptual/AppleTV_PG/index.html#//apple_ref/doc/uid/TP40015241).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)