ZSWTappableLabel icon indicating copy to clipboard operation
ZSWTappableLabel copied to clipboard

Number of lines is ignored

Open peterpaulis opened this issue 4 years ago • 6 comments

Doesn't support number of lines as the UILabel

peterpaulis avatar Oct 29 '20 13:10 peterpaulis

Can you share an example of this not working?

zacwest avatar Oct 29 '20 15:10 zacwest

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

peterpaulis avatar Oct 29 '20 16:10 peterpaulis

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?

zacwest avatar Oct 30 '20 16:10 zacwest

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

revolter avatar Feb 05 '21 08:02 revolter

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 avatar Feb 05 '21 08:02 revolter

This simple implementation works perfectly.

revolter avatar Feb 05 '21 11:02 revolter