hitTest(_:)
Returns the farthest descendant of the receiver in the layer hierarchy (including itself) that contains the specified point.
Declaration
func hitTest(_ p: CGPoint) -> CALayer?Parameters
- p:
A point in the coordinate system of the receiver’s superlayer.
Return Value
The layer that contains thePoint or nil if the point lies outside the receiver’s bounds rectangle.