iOS TTTAttributedLabel Delegate didSelectLinkWithURL not getting called

前端 未结 4 1450
灰色年华
灰色年华 2021-02-07 17:45

I\'m having problems setting up the TTTAttributedLabel within my project.

I have set the protocol delegate in my header file

@interface TwitterFeedContr         


        
4条回答
  •  无人共我
    2021-02-07 18:34

    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;

提交回复
热议问题