BalestraPatrick/WhatsNew

Dynamic Type warnings with iOS 9 deployment

zarzonis opened this issue · 7 comments

Hi,

I updated your library to the latest version and I get a few warning regarding dynamic type. Specifically you enabled dynamic type with iOS 9 deployment target but the dynamic type is available only on iOS 10 or later.

Here is a screenshot of the warnings.

screen shot 2017-11-11 at 21 49 45

This is caused since the xib files have specified to use the dynamic font size. I guess the only solution is to specify the font on all labels programmatically inside an if #available(iOS 10, *). I'll think about a clever solution or otherwise fallback to do everything programmatically :(

That's exactly the reason of the warnings. I think that the only way to solve this is to specify the font programmatically inside the if #available statement you already mentioned. If you come up with something better, please let me know.

Fixed in release 0.3! 😄

My project with iOS 10 deployment.

I think the UIFont.preferredFont(forTextStyle: .headline) for titleLabel.font is to small

img_4516

I print the font.fontDescriptor.pointSize is 17, same as the .body style.

@nixzhu You're right, I changed the title text style to be .title2 so its pointSize is now 22 in release 0.3.1.

@BalestraPatrick .title2 is big enough, but it's not bold.

I have try the following code is good for display:

let fontDescriptor = UIFont.preferredFont(forTextStyle: .headline).fontDescriptor
let font = UIFont(descriptor: fontDescriptor, size: fontDescriptor.pointSize + 5)
titleLabel.font = font

But I think it's better if we can customize the item's font directly.

Feel free to submit a PR to make the title bold and expose the font property to be customizable :)