---
title: masksToBounds
framework: quartzcore
role: symbol
role_heading: Instance Property
path: quartzcore/calayer/maskstobounds
---

# masksToBounds

A Boolean indicating whether sublayers are clipped to the layer’s bounds. Animatable.

## Declaration

```swift
var masksToBounds: Bool { get set }
```

## Discussion

Discussion When the value of this property is true, Core Animation creates an implicit clipping mask that matches the bounds of the layer and includes any corner radius effects. If a value for the mask property is also specified, the two masks are multiplied to get the final mask value. The default value of this property is false.

## See Also

### Modifying the layer’s appearance

- [contentsGravity](quartzcore/calayer/contentsgravity.md)
- [Contents Gravity Values](quartzcore/contents-gravity-values.md)
- [opacity](quartzcore/calayer/opacity.md)
- [isHidden](quartzcore/calayer/ishidden.md)
- [mask](quartzcore/calayer/mask.md)
- [isDoubleSided](quartzcore/calayer/isdoublesided.md)
- [cornerRadius](quartzcore/calayer/cornerradius.md)
- [maskedCorners](quartzcore/calayer/maskedcorners.md)
- [CACornerMask](quartzcore/cacornermask.md)
- [borderWidth](quartzcore/calayer/borderwidth.md)
- [borderColor](quartzcore/calayer/bordercolor.md)
- [backgroundColor](quartzcore/calayer/backgroundcolor.md)
- [shadowOpacity](quartzcore/calayer/shadowopacity.md)
- [shadowRadius](quartzcore/calayer/shadowradius.md)
- [shadowOffset](quartzcore/calayer/shadowoffset.md)
