Type Method

needsDisplay(forKey:)

Returns a Boolean indicating whether changes to the specified key require the layer to be redisplayed.

Declaration

class func needsDisplay(forKey key: String) -> Bool

Parameters

key

A string that specifies an attribute of the layer.

Return Value

true if the layer requires a redisplay.

Discussion

Subclasses can override this method and return true if the layer should be redisplayed when the value of the specified attribute changes. Animations changing the value of the attribute also trigger redisplay.

The default implementation of this method returns false.

See Also

Updating Layer Display

func setNeedsDisplay()

Marks the layer’s contents as needing to be updated.

func setNeedsDisplay(CGRect)

Marks the region within the specified rectangle as needing to be updated.

var needsDisplayOnBoundsChange: Bool

A Boolean indicating whether the layer contents must be updated when its bounds rectangle changes.

func displayIfNeeded()

Initiates the update process for a layer if it is currently marked as needing an update.

func needsDisplay() -> Bool

Returns a Boolean indicating whether the layer has been marked as needing an update.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software