现在我已经在 UITextView 中检测到长按
- (void)viewDidLoad
{
[super viewDidLoad];
UILongPressGestureRecognizer *LongPressgesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPressFrom:)];
[[self textview] addGestureRecognizer:LongPressgesture];
longPressGestureRecognizer.delegate = self;
}
- (void) handleLongPressFrom: (UISwipeGestureRecognizer *)recognizer
{
CGPoint location = [recognizer locationInView:self.view];
NSLog(@"Tap Gesture Coordinates: %.2f %.2f", location.x, location.y);
}
现在,我应该如何获取长按的单词内容,并获取该单词的矩形以准备显示 PopOver?