Skip to content

Instantly share code, notes, and snippets.

Created Apr 26, 2020
What would you like to do?
Method for work with sublayers
var sublayers: [CALayer]? - //Array of all sublayers in current layer
var superlayer: CALayer? - //Parent layer if exist
func addSublayer(CALayer) - //Add new sublayer
func removeFromSuperlayer() - //Remove layer from superLayer
func insertSublayer(CALayer, at: UInt32) - //Insert new layer on specific index
func insertSublayer(CALayer, below: CALayer?) - //Insert sublayer bellow specific layer
func insertSublayer(CALayer, above: CALayer?) - //Insert sublayer above specific layer
func replaceSublayer(CALayer, with: CALayer) - //Switch places of 2 sublayers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment