I'm having problems setting up the TTTAttributedLabel within my project.
I have set the protocol delegate in my header file
@interface TwitterFeedControlleriPad : UIViewController <TTTAttributedLabelDelegate, UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateWaterfallLayout>
I have set the ViewController to it (is not nil, I checked already).
cell.tweetLabel.delegate = self;
It's showing all the links right in the label but when I tap them it's not calling the function.
- (void)attributedLabel:(TTTAttributedLabel *)label didSelectLinkWithURL:(NSURL *)url
I've already used it before with success and it's exactly the same code!! It's driving me crazy!
I understand it is not your case, but this is for everyone who have the same problem as I had and stumble on this thread.
I had an UITapGestureRecognizer
on the same view as the TTTAttributedLabel
. Because of the first one, the 'touchEnded
' function of the TTTAttributedLabel
wasn't called, which is responsible for handling clicked links.
I solved the problem by adding the line: tapGestureRecognizer.cancelsTouchesInView = NO;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With