---
title: "unregister(imageWith:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uiimageasset/unregister(imagewith:)"
---

# unregister(imageWith:)

Unregisters the image with the specified trait collection from the image asset.

## Declaration

```swift
func unregister(imageWith traitCollection: UITraitCollection)
```

## Parameters

- `traitCollection`: A trait collection containing the traits for a previously registered image. This method matches only the trait values, so you don’t need to specify the same object you used at registration time.

## Discussion

Discussion This method searches for an image whose trait collection matches the one in the traitCollection parameter. The traits in both collections must match exactly, and the matching trait collection must be associated with an image that you registered previously.

## See Also

### Registering and unregistering images

- [register(_:with:)](uikit/uiimageasset/register(_:with:)-2plm5.md)
- [register(_:with:)](uikit/uiimageasset/register(_:with:)-89c5b.md)
- [unregisterImage(with:)](uikit/uiimageasset/unregisterimage(with:).md)
