gpt4 book ai didi

ios - UIGestureRecognizer 确定点击

转载 作者:行者123 更新时间:2023-11-28 21:27:28 25 4
gpt4 key购买 nike

我在 SO 上遵循了这个答案:https://stackoverflow.com/a/12481177/2575115

但我得到一个错误“Expected Expression”。我做错了什么?

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch;
{
BOOL shouldReceiveTouch = YES;

if (gestureRecognizer == tap) { //Expected Expression
shouldReceiveTouch = (touch.view == _shownImage);
}
return shouldReceiveTouch;
}

最佳答案

你可以查看 UIGestureRecognizer 类

-(BOOL) gestureRecognizer: (UIGestureRecognize *) gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer: (UIGestureRecognizer *) otherGestureRecognizer {
if ([gestureRecognizer isMemberOfClass: [UITapGestureRecognizer class]]) {

shouldReceiveTouch = (touch.view == _shownImage);

}
}

关于ios - UIGestureRecognizer 确定点击,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37538107/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com