Instance Method


Returns whether the receiver contains a specified point.


func contains(_ p: CGPoint) -> Bool



A point in the receiver’s coordinate system.

Return Value

true if the bounds of the layer contains the point.

See Also

Hit Testing

func hitTest(CGPoint) -> CALayer?

Returns the farthest descendant of the receiver in the layer hierarchy (including itself) that contains the specified point.

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