अब मैं पहले से ही लंबी नल UITextView में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 दिखाने के लिए तैयार करने के लिए शब्द?
कृपया जांच करें http://stackoverflow.com/questions/8811909/getting-the-word-touched-in-a-uilabel-uitextview/21577829#21577829। मैंने 'UITapGestureRecognizer 'का उपयोग किया है, जिसे आप इसे' UILongPressGestureRecognizer 'से बदल सकते हैं। – TheTiger