I have added a label with some text and links to an ScrollView, when you tap on those links (in the label), a delegate method will call, displays a popover and show some related information.
but problem starts from here, I want when you tap on anywhere else except the links, the popover disappear.
if I add a UITapGestureRecognizer to ScrollView, the delegate method for links won't call.
what should I do to label handles the tap on links, and ScrollView Handles the other taps?
I did like that:
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapped)];
[self.scrollView addGestureRecognizer:tap];
- (void)tapped
{
if ([self.storyText.delegate respondsToSelector:@selector(attributedLabel:shouldFollowLink:)])
[self.storyText.delegate performSelector:@selector(attributedLabel:shouldFollowLink:) withObject:self.storyText];
}
In tapped method Im checking if Im tapping on a link, the delegate should be called, but Delegate wont call. Am I missing someThing?