Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9159163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:25:31+00:00 2026-06-17T13:25:31+00:00

I have added a label with some text and links to an ScrollView, when

  • 0

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?

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T13:25:32+00:00Added an answer on June 17, 2026 at 1:25 pm

    Solved!
    Solution:
    first I create a custom class for my scrollView and subclassed that from UIScrollView.
    Second I override

    -(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
    

    in my custom ScrollView class. in this method I called a method to dismiss the popover.

    but important part is that in viewWillAppear method of the class which popover will appear, I passed self to custom scrollView class. because if I didn’t that, the method for dismissing popover won’t work (it needs an object of this class).

    [self.scrollView initWithStoryViewController:self];
    

    enter image description here

    this images show in which scenario I had this problem:

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have added some text to a UITableViewCell by creating the label with the
I have added an extra field Specification in Catalog->Product->Data tab. This text is stored
I have added username to a devise authentication setup, and for some reason, it's
if creating a dictionary program. when use copy some text on clipboard it will
I have added some custom variables to customer and I want to use them
I'm working on My First ASP.NET Application. I have created some text boxes and
I have encoutnered some issues when trying to change the input text box initial
I have created a zend form. I have added some elements. I have put
I have a UIScrollview in a tab, i added some UIView (NIB) to the
My storyboard seems locked. I have added new labels and imageviews to two different

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.