---
title: "addRenderingAttribute(_:value:for:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/nstextlayoutmanager/addrenderingattribute(_:value:for:)"
---

# addRenderingAttribute(_:value:for:)

Sets the rendering attribute for the value and range you specify.

## Declaration

```swift
func addRenderingAttribute(_ renderingAttribute: NSAttributedString.Key, value: Any?, for textRange: NSTextRange)
```

## Parameters

- `renderingAttribute`: The doc://com.apple.documentation/documentation/Foundation/NSAttributedString/Key that represents the attribute.
- `value`: The value for the attribute.
- `textRange`: The range over which to apply the attribute.

## Discussion

Discussion Passing nil overrides the specified attribute by removing it from the final attributes the framework passes to the layout and rendering engine. This is a convenience method for setRenderingAttributes(_:for:).

## See Also

### Adjusting rendering

- [linkRenderingAttributes](uikit/nstextlayoutmanager/linkrenderingattributes.md)
- [enumerateRenderingAttributes(from:reverse:using:)](uikit/nstextlayoutmanager/enumeraterenderingattributes(from:reverse:using:).md)
- [renderingAttributes(forLink:at:)](uikit/nstextlayoutmanager/renderingattributes(forlink:at:).md)
- [invalidateRenderingAttributes(for:)](uikit/nstextlayoutmanager/invalidaterenderingattributes(for:).md)
- [removeRenderingAttribute(_:for:)](uikit/nstextlayoutmanager/removerenderingattribute(_:for:).md)
- [setRenderingAttributes(_:for:)](uikit/nstextlayoutmanager/setrenderingattributes(_:for:).md)
