setNeedsDisplay()
Marks the layer’s contents as needing to be updated.
Declaration
func setNeedsDisplay()Discussion
Calling this method causes the layer to recache its content. This results in the layer potentially calling either the display(_:) or draw(_:in:) method of its delegate. The existing content in the layer’s contents property is removed to make way for the new content.