zacwest / ZSWTappableLabel

UILabel subclass for links which are tappable, long-pressable, 3D Touchable, and VoiceOverable.
MIT License
169 stars 37 forks source link

If link is in paragraph, which has setLineBreakMode == NSLineBreakByTruncatingTail than link tap is not detected #41

Open peterpaulis opened 4 years ago

peterpaulis commented 4 years ago
    // p
    {
        NSMutableParagraphStyle * ps = [[NSMutableParagraphStyle alloc] init];
        [ps setLineHeightMultiple:1.1];
        [ps setLineBreakMode:NSLineBreakByTruncatingTail];

        NSDictionary * a = @{
            NSFontAttributeName: [UIFont systemFontOfSize:self.newsTitleLabel.font.pointSize],
            NSForegroundColorAttributeName: textColor,
            NSParagraphStyleAttributeName: ps
        };
        [options setAttributes:a forTagName:@"p"];
    }

removing the [ps setLineBreakMode:NSLineBreakByTruncatingTail];

makes the tap detection work again