sob*_*dio 3 iphone core-graphics ipad uigesturerecognizer ios
有没有办法知道"点击"是否在UIView的屏蔽区域内部或外部?我正在使用CoreGraphics掩盖UIView.

到目前为止我的代码是这样的..
- (void)viewDidLoad {
UIGestureRecogniser *r = [[UIGestureRecogniser alloc] initWithTarget:self action:@selector(gestCall:)];
[self addGestureRecogniser:r];
}
- (void)gestCall:(UIGestureRecogniser *)gestRec {
if ("somthing") {
// outside of mask
} else {
// inside of mask
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢.
我终于找到了我想要的解决方案.因此,为了任何一个试图找到的人的利益是CGPoint在任何CGPath内.
这很简单.
UIBezierPath *p = [UIBezierPath bezierPathWithCGPath:anyCGPath];
BOOL isInPath = [p containsPoint:anyCGPoint];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
740 次 |
| 最近记录: |