Krelborn / KILabel

A simple to use drop in replacement for UILabel for iOS 7 and above that highlights links such as URLs, twitter style usernames and hashtags and makes them touchable.
MIT License
470 stars 133 forks source link

tap handlers not responding. #53

Open ismyhc opened 8 years ago

ismyhc commented 8 years ago

I cannot seem to get the tap handlers to work. Ive tried hashtag and url link handlers. I see the link highlight when touching, but code within handler not getting called.

self.cardDescriptionLabel.userInteractionEnabled = true
self.cardDescriptionLabel.urlLinkTapHandler = { label, url, range in
    print("Test")   
}
Viniciuscarvalho commented 8 years ago

Me too, tha same problem,

if (self.photoToVote.owner.type == ProfileTypeBlogger) {
        lblUserQuestion.automaticLinkDetectionEnabled = YES;
        lblUserQuestion.urlLinkTapHandler             = ^(KILabel *lblUserQuestion, NSString *string, NSRange range) {
            [self attemptOpenURL:[NSURL URLWithString:string]];
            NSLog(@"URL tapped %@", string);
        };
    }
sandeeprana011 commented 6 years ago

Same happening with me.

 // Attach a block to be called when the user taps a URL
            self.lTitleText.urlLinkTapHandler = { label, url, range in
                NSLog("URL \(url) tapped")
                print("clicked label \(label) Url \(url) Range \(range)");
            }