removeFromSuperlayer()
Detaches the layer from its parent layer.
Declaration
func removeFromSuperlayer()Discussion
You can use this method to remove a layer (and all of its sublayers) from a layer hierarchy. This method updates both the superlayer’s list of sublayers and sets this layer’s superlayer property to nil.