Author
Travis Kirton


Mask to Bounds

Particularly convenient when adding one view to another, setting the masksToBounds property will ensure that any visible contents outside of a view’s frame will be clipped.

view.masksToBounds = true

Example

let img = Image("chop")!
img.center = canvas.center
img.border.width = 10.0
img.border.color = C4Pink
canvas.add(img)