Returns a Boolean value indicating whether the area enclosed by the receiver contains the specified point.
- iOS 3.2+
- tvOS 9.0+
- watchOS 2.0+
The point to test against the path, specified in the path object's coordinate system.
true if the point is considered to be within the path’s enclosed area or
false if it is not.
The receiver contains the specified point if that point is in a portion of a closed subpath that would normally be painted during a fill operation. This method uses the value of the
uses property to determine which parts of the subpath would be filled.
A point is not considered to be enclosed by the path if it is inside an open subpath, regardless of whether that area would be painted during a fill operation. Therefore, to determine mouse hits on open paths, you must create a copy of the path object and explicitly close any subpaths (using the
close() method) before calling this method.