---
title: "titleWidth(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsformcell/titlewidth(_:)"
---

# titleWidth(_:)

Returns the width of the title field constrained to the specified size.

## Declaration

```swift
func titleWidth(_ size: NSSize) -> CGFloat
```

## Parameters

- `size`: The maximum size of the field when calculated by the Application Kit.

## Return Value

Return Value The width of the title field, measured in points in the user coordinate space.

## Discussion

Discussion If you set the width using titleWidth, this method returns the value you set; otherwise, the Application Kit calculates the width, constraining the field size to the specified value.

## See Also

### Related Documentation

- [titleWidth](appkit/nsformcell/titlewidth.md)
