zacwest / ZSWTappableLabel

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

Number of lines is ignored #40

Open peterpaulis opened 4 years ago

peterpaulis commented 4 years ago

Doesn't support number of lines as the UILabel

zacwest commented 4 years ago

Can you share an example of this not working?

peterpaulis commented 4 years ago

you can set the number of lines, but the label renders as with numberOfLines = 0

zacwest commented 4 years ago

This class does not do any drawing, so if there's an issue with constraining the sizing it's likely how you are configuring it. Does the issue still reproduce if you replace ZSWTappableLabel with UILabel?

revolter commented 3 years ago

I think that this is related to the fact that adjustsFontSizeToFitWidth doesn't work either.

revolter commented 3 years ago

Oh, it works if you set lineBreakMode to NSLineBreakByTruncatingTail, but then the tap detection breaks. So this library doesn't allow you to have a label with both autoshrinking text and tappable links.

revolter commented 3 years ago

This simple implementation works perfectly.