---
title: "init(rect:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nsvalue/init(rect:)"
---

# init(rect:)

Creates a new value object containing the specified Foundation rectangle structure.

## Declaration

```swift
init(rect: NSRect)
```

## Parameters

- `rect`: The value for the new object.

## Return Value

Return Value A new value object that contains the data in the rect structure.

## See Also

### Related Documentation

- [NSRect](foundation/nsrect.md)

### Working with Foundation Geometry Values

- [init(point:)](foundation/nsvalue/init(point:).md)
- [init(size:)](foundation/nsvalue/init(size:).md)
- [pointValue](foundation/nsvalue/pointvalue.md)
- [sizeValue](foundation/nsvalue/sizevalue.md)
- [rectValue](foundation/nsvalue/rectvalue.md)
