Attributed string with custom fonts in storyboard does not load correctly

后端 未结 16 1875
梦谈多话
梦谈多话 2021-01-30 03:35

We are using custom fonts in our project. It works well in Xcode 5. In Xcode 6, it works in plain text, attributed string in code. But those attributed strings set in storyboard

16条回答
  •  故里飘歌
    2021-01-30 04:13

    @Hamidptb solution works, make sure to get the correct name of the font (once you've added it to Font Book)

    • Open the Font Book application, navigate to your font then press Command+I. The PostScript name is the font name you want to use here:

      UILabel.appearance().font = UIFont(name: "PostScriptName", size: 17)

提交回复
热议问题