---
title: "register(_:with:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uiimageasset/register(_:with:)-89c5b"
---

# register(_:with:)

Registers an image with the specified image configuration details.

## Declaration

```swift
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

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 displayScale property. You may experience unexpected results from image(with:) if the trait collection doesn’t explicitly define the desired scale.

## See Also

### Registering and unregistering images

- [register(_:with:)](uikit/uiimageasset/register(_:with:)-2plm5.md)
- [unregister(imageWith:)](uikit/uiimageasset/unregister(imagewith:).md)
- [unregisterImage(with:)](uikit/uiimageasset/unregisterimage(with:).md)
