---
title: "setContentWidth(_:type:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstextblock/setcontentwidth(_:type:)"
---

# setContentWidth(_:type:)

Sets the width of the text block.

## Declaration

```swift
func setContentWidth(_ contentWidth: CGFloat, type: NSTextBlock.ValueType)
```

## Parameters

- `type`: The type of value being provided. This controls how val is interpreted.

## See Also

### Working with dimensions of content

- [setValue(_:type:for:)](appkit/nstextblock/setvalue(_:type:for:).md)
- [value(for:)](appkit/nstextblock/value(for:).md)
- [valueType(for:)](appkit/nstextblock/valuetype(for:).md)
- [contentWidth](appkit/nstextblock/contentwidth.md)
- [contentWidthValueType](appkit/nstextblock/contentwidthvaluetype.md)
- [NSTextBlock.Dimension](appkit/nstextblock/dimension.md)
- [NSTextBlock.ValueType](appkit/nstextblock/valuetype.md)
