首页 > 解决方案 > 如何快速加载框架中的自定义字体?

问题描述

我正在开发自定义框架并希望从项目设置中导入自定义字体。

我已按照以下所有步骤操作:

     * Added external fonts into the project folder.
     * Added into the build targets.
     * Fonts are added in the Copy bundle resources in the project target settings.
     * Fonts are added in the Property list

但总是得到 nil 对象。如果我在普通应用程序中尝试它工作正常。当我尝试导入我的自定义框架并且它不起作用时。

请指教。

extension UIFont {
   static let systemFontRegular = "SFProText-Regular"{
   return UIFont(name: systemFontRegular, size: size)!
  }
}

标签: iosswiftframeworkscustom-font

解决方案


推荐阅读