有沒有辦法知道'tap'是在UIView的蒙面區域內部還是外部?我正在使用CoreGraphics來掩蓋UIView。UIGestureRecogniser在蒙面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
}
}
謝謝。
澄清我想知道CGPoint是否在CGPath內。我認爲這可能是一個簡單的方法。我對Core Graphics沒有經驗。 –
好的。你想要達到什麼目的?你想要哪種手勢?它只是單擊?你的面具總是呈圓形嗎? – applefreak
檢查我發佈的SO鏈接。你可能需要鍛鍊一點。 – applefreak