Post

Replies

Boosts

Views

Activity

How to get UIFont for 'SF Pro Display' consistently?
Hi! I'm an engineer creating ProtoPie, at Studio XID. We are creating prototyping tool (like Framer), and our customers can author app prototypes on our desktop app play the app prototypes on our iOS app Our desktop app is providing several font options commonly used, that contains SF Pro Display SF Pro Rounded SF Pro Text SF Compact Display SF Compact Rounded SF Compact Text And I'm finding the ways to get UIFont instance for these fonts consistently. Our target version is iOS >= 10 I'm trying to get UIFont like UIFont(name: ".SFProText-Regular", size: 19) But it prints warning 'All system UI font access should be through proper APIs...'. I found it is old way and does not work in iOS 13. And then, I tried print(UIFont.systemFont(ofSize: 19).fontName) print(UIFont.systemFont(ofSize: 20).fontName) And both print '.SFUI-Regular'. I don't know what this font is. (SF Pro Display? SF Pro Text? or something?) Is there any consistent way to get UIFont for those 6 fonts? Thanks in advance!
1
0
9.9k
Jul ’20