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 8987591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:50:01+00:00 2026-06-15T21:50:01+00:00

I figured out how to make in core text a url tappable but i

  • 0

I figured out how to make in core text a url tappable but i can not figure out how to make other words tappable like ‘my name is @george’ . I would like @george to be tappable in core text. Is there a way? I am trying like this to make it tappable:

CFAttributedStringSetAttribute(string, CFRangeMake( 0, mystring.length ), kCTFontAttributeName, ctFontBold );
        CFAttributedStringSetAttribute(string, CFRangeMake( mystring.length, linestring.length ), kCTFontAttributeName, ctFont);
        CFAttributedStringSetAttribute(string, CFRangeMake( mystring.length, linestring.length ), kCTParagraphStyleAttributeName, paragraphStyle);
         CFAttributedStringSetAttribute(string, CFRangeMake(0, mystring.length), kCTForegroundColorAttributeName, [UIColor blackColor].CGColor);
             CFAttributedStringSetAttribute(string, CFRangeMake(0, mystring.length),
                                            (CFStringRef)@"CustomLink",mystring);

Then when i tap on the word i retrieve it like this:

NSString* myString = [attributes objectForKey:@"CustomLink"];

but i get (null) all the time. This does not happen when it is a URL!

Any help appreciated!

Thanks.

I detect the touch by a gesture recogniser:

CTFrameRef ctFrame = CTFramesetterCreateFrame( framesetter, CFRangeMake(0, text.length),path, NULL );


    CFArrayRef lines = CTFrameGetLines(ctFrame);

    CGPoint* lineOrigins = malloc(sizeof(CGPoint)*CFArrayGetCount(lines));


    NSInteger index=0;

    int ii=0;

    for(CFIndex i = 0; i < CFArrayGetCount(lines); i++)
    {

        CGFloat y;

        CTFrameGetLineOrigins( ctFrame, CFRangeMake(0, 0), lineOrigins);


        CTLineRef line = (CTLineRef)CFArrayGetValueAtIndex(lines, i);
        CGPoint origin = lineOrigins[i];
        y = bottomLabel.bounds.origin.y +  bottomLabel.bounds.size.height - origin.y;
        ii=i;
        if (reversePoint.y > origin.y) {

            index = CTLineGetStringIndexForPosition(line, reversePoint);
            CFArrayRef runs = CTLineGetGlyphRuns(line);



            for(CFIndex j = 0; j < CFArrayGetCount(runs); j++)
            {
                CTRunRef run = CFArrayGetValueAtIndex(runs, j);

                CGRect runBounds;

                CGFloat ascent;//height above the baseline
                CGFloat descent;//height below the baseline
                runBounds.size.width = CTRunGetTypographicBounds(run, CFRangeMake(0, 0), &ascent, &descent, NULL);
                runBounds.size.height = ascent + descent;

                CGFloat xOffset = CTLineGetOffsetForStringIndex(line, CTRunGetStringRange(run).location, NULL);
                runBounds.origin.x = origin.x + rect.origin.x + xOffset;
                runBounds.origin.y = y;//+ rect.origin.y;
                runBounds.origin.y -= (descent+ascent)-5;


                NSDictionary* attributes = (NSDictionary*)CTRunGetAttributes(run);
                NSString* urlString = [attributes objectForKey:@"CustomLink"];
                               if(urlString && ![urlString isEqualToString:@""])
                {



                    [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(showwebview:) userInfo:urlString repeats:NO];



                    return;
                }
}
}
  • 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-15T21:50:03+00:00Added an answer on June 15, 2026 at 9:50 pm

    Use TTTAttributedLabel. It supports hyperlink.

    Refer TTTAttributedLabel-string-as-text-and-links) for example how to use.

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

Sidebar

Related Questions

I have a menu working fairly well but can't figure out how to make
I am fighting now like hours to figure out how to make possible to
http://jsfiddle.net/DaJWC/ i can't figure out how to make one of the links reverse so
I've been looking over this post, but still can't figure out how to solve
I am trying to figure out how to make my layout have the following
I'm trying to figure out how to make it so that when I'm moving
I'm trying to figure out how to make jQuery slide #content2 down and replace
I did tons of methods to figure out how to make this mod rewrite
I'm trying to figure out a way to make demos for a program I've
I'm trying to figure out how if there's a way to make a hostname

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.