<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIImageAsset/register(_:with:)-89c5b",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIImageAsset(im)registerImage:withConfiguration:"
  },
  "title" : "register(_:with:)"
}
-->

# register(_:with:)

Registers an image with the specified image configuration details.

```
func register(_ image: UIImage, with configuration: UIImage.Configuration)
```

## Parameters

`image`

The image you want to register with the image asset.

`configuration`

The image configuration details to associate with `image`.

## Discussion

Each image in an image asset must have a unique configuration. If the asset already contains a registered image with the equivalent configuration, it replaces that image with the one in the `image` parameter.

> Important:
> The trait collection in `configuration` must always contain an explicit value in its ``doc://com.apple.uikit/documentation/UIKit/UITraitCollection/displayScale`` property. You may experience unexpected results from ``doc://com.apple.uikit/documentation/UIKit/UIImageAsset/image(with:)-8jdwv`` if the trait collection doesn’t explicitly define the desired scale.

---

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)