---
title: contentsRect
framework: quartzcore
role: symbol
role_heading: Instance Property
path: quartzcore/calayer/contentsrect
---

# contentsRect

The rectangle, in the unit coordinate space, that defines the portion of the layer’s contents that should be used. Animatable.

## Declaration

```swift
var contentsRect: CGRect { get set }
```

## Discussion

Discussion Defaults to the unit rectangle (0.0, 0.0, 1.0, 1.0). If pixels outside the unit rectangle are requested, the edge pixels of the contents image will be extended outwards. If an empty rectangle is provided, the results are undefined.

## See Also

### Providing the layer’s content

- [contents](quartzcore/calayer/contents.md)
- [contentsCenter](quartzcore/calayer/contentscenter.md)
- [display()](quartzcore/calayer/display().md)
- [draw(in:)](quartzcore/calayer/draw(in:).md)
