I have a TTTAttributed Label which detect link on it by self and I have a tap gesture on it which perform some action.
The problem is when I have a tap gesture on it then it cant be able to open the link It only can perform the action by tap gesture But I want that if the text is link type then my tap gesture do forward the tap to the link detection of TTTAttributed label.
Your effort is truly appreciate. Thanks in advance.
label.enabledTextCheckingTypes = NSTextCheckingTypeLink; // Automatically detect links when the label text is subsequently changed
label.delegate = self; // Delegate methods are called when the user taps on a link (see `TTTAttributedLabelDelegate` protocol)
label.text = @"Google it! (https://www.google.co.in/)"; // Repository URL will be automatically detected and linked
NSRange range = [label.text rangeOfString:@"Google"];
[label addLinkToURL:[NSURL URLWithString:@"http://google.com/"] withRange:range]; // Embedding a custom link in a substring
Set the delegate of the TTTAttributed label and when the user will tap on the label its delegate method will get invoked.
(void)attributedLabel:(TTTAttributedLabel *)label didSelectLinkWithURL:(NSURL *)url
Handle your event in this delegate method.