---
title: "setWidth(_:type:for:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/nstextblock/setwidth(_:type:for:)"
---

# setWidth(_:type:for:)

## Declaration

```swift
func setWidth(_ width: CGFloat, type: NSTextBlock.ValueType, for layer: NSTextBlock.Layer)
```

## Mentioned in

Adding tables to attributed strings in UIKit

## See Also

### Setting layer widths

- [setWidth(_:type:for:rectEdge:)](uikit/nstextblock/setwidth(_:type:for:rectedge:).md)
- [width(for:rectEdge:)](uikit/nstextblock/width(for:rectedge:).md)
- [widthValueType(for:rectEdge:)](uikit/nstextblock/widthvaluetype(for:rectedge:).md)
