我想向我的UITextView添加一个 *UITapGestureRecognize*r ,因为我想关闭TextView所在的“Popup” 。所以我希望在 T*extView 时调用Popup类的方法“hide” * 被点击。我尝试了以下方法,但由于某种原因它不起作用:
UITapGestureRecognizer *gr = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(show)];
[gr setNumberOfTapsRequired:1];
[viewText addGestureRecognizer:gr];
我也不想为它创建一个子类,因为我需要调用“父”方法“隐藏”。
也许您现在是该问题的一个很好的解决方案。
先感谢您。