---
title: "withConfiguration(_:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uiimage/withconfiguration(_:)"
---

# withConfiguration(_:)

Returns a new version of the current image, replacing the current configuration attributes with the specified attributes.

## Declaration

```swift
func withConfiguration(_ configuration: UIImage.Configuration) -> UIImage
```

## Parameters

- `configuration`: The new configuration attributes to associate with the image.

## Return Value

Return Value A new version of the image object that contains the specified configuration details.

## Discussion

Discussion This method creates a new image object, replacing the image’s current configuration with the values specified in the configuration parameter.

## See Also

### Changing the image attributes

- [applyingSymbolConfiguration(_:)](uikit/uiimage/applyingsymbolconfiguration(_:).md)
- [imageFlippedForRightToLeftLayoutDirection()](uikit/uiimage/imageflippedforrighttoleftlayoutdirection().md)
- [withHorizontallyFlippedOrientation()](uikit/uiimage/withhorizontallyflippedorientation().md)
- [withRenderingMode(_:)](uikit/uiimage/withrenderingmode(_:).md)
- [withAlignmentRectInsets(_:)](uikit/uiimage/withalignmentrectinsets(_:).md)
- [resizableImage(withCapInsets:)](uikit/uiimage/resizableimage(withcapinsets:).md)
- [resizableImage(withCapInsets:resizingMode:)](uikit/uiimage/resizableimage(withcapinsets:resizingmode:).md)
- [imageWithoutBaseline()](uikit/uiimage/imagewithoutbaseline().md)
- [withBaselineOffset(fromBottom:)](uikit/uiimage/withbaselineoffset(frombottom:).md)
- [UIImage.Configuration](uikit/uiimage/configuration-swift.class.md)
- [UIImage.SymbolConfiguration](uikit/uiimage/symbolconfiguration-swift.class.md)
