Skip to content

Instantly share code, notes, and snippets.

@daoseng33
Last active November 21, 2019 11:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daoseng33/51baad3a2d58246884188389923bbde7 to your computer and use it in GitHub Desktop.
Save daoseng33/51baad3a2d58246884188389923bbde7 to your computer and use it in GitHub Desktop.
let maskPath = UIBezierPath(roundedRect: view.bounds, byRoundingCorners: [.topLeft, .topRight], cornerRadii: CGSize(width: 5, height: 5))
let maskLayer = CAShapeLayer()
maskLayer.frame = view.bounds
maskLayer.path = maskPath.cgPath
view.layer.mask = maskLayer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment