Detecting tap inside a bezier path

后端 未结 4 639
生来不讨喜
生来不讨喜 2020-12-11 02:00

I have a UIView which is added as a subview to my view controller. I have drawn a bezier path on that view. My drawRect implementation is below

- (void)drawR         


        
4条回答
  •  悲哀的现实
    2020-12-11 02:58

    There is a function CGPathContainsPoint() it may be useful in your case.

    Also be careful if you get gesture point from superview, the coordinate may not be correct with your test. You have a method to convertPoint from or to a particular view's coordinate system:

    - (CGPoint)convertPoint:(CGPoint)point toView:(UIView *)view
    - (CGPoint)convertPoint:(CGPoint)point fromView:(UIView *)view
    

提交回复
热议问题