Skip to content

Instantly share code, notes, and snippets.

Created Apr 26, 2020
What would you like to do?
Add sublayers to layer of UIView
// MARK: Creation of sublayer1
let sublayer1 = CALayer()
sublayer1.frame = CGRect(x: 20, y: 20, width: 30, height: 30)
sublayer1.backgroundColor =
// MARK: Creation of sublayer2
let sublayer2 = CALayer()
sublayer2.frame = CGRect(x: 80, y: 80, width: 40, height: 40)
sublayer2.backgroundColor =
//Adding of sublayers to view.layer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment