In an animation I added a lot of sublayers to a view, with:
[self.view.layer addSublayer:layer1]; [self.view.layer addSublayer:
Swift 3.0 & Swift 4.0
Set the sublayers property to nil to remove all sublayers from a view.
sublayers
nil
view.layer.sublayers = nil
also you can add
.removeAll()