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

# init(CGRect:)

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

## Declaration

```swift
init(CGRect rect: CGRect)
```

```swift
init(cgRect rect: CGRect)
```

## Parameters

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

## Return Value

Return Value A new value object that contains the rectangle information.

## See Also

### Related Documentation

- [CGRect](corefoundation/cgrect.md)

### Working with CoreGraphics Geometry Values

- [init(CGPoint:)](foundation/nsvalue/init(cgpoint:).md)
- [init(CGVector:)](foundation/nsvalue/init(cgvector:).md)
- [init(CGSize:)](foundation/nsvalue/init(cgsize:).md)
- [init(CGAffineTransform:)](foundation/nsvalue/init(cgaffinetransform:).md)
- [cgPointValue](foundation/nsvalue/cgpointvalue.md)
- [cgVectorValue](foundation/nsvalue/cgvectorvalue.md)
- [cgSizeValue](foundation/nsvalue/cgsizevalue.md)
- [cgRectValue](foundation/nsvalue/cgrectvalue.md)
- [cgAffineTransformValue](foundation/nsvalue/cgaffinetransformvalue.md)
