I added custom font to a framework. I followed all the steps, but it doesn\'t work.
I am able to set the font in Interface Builder, but when I build the project it d
The following solution allows you to load all fonts with a certain extension automatically:
static func registerFonts() {
let fonts = Bundle(for:
OrientationMonitor.self).urls(forResourcesWithExtension: "ttf", subdirectory: nil)
fonts?.forEach({ url in
CTFontManagerRegisterFontsForURL(url as CFURL, .process, nil)
})
}
Make sure to replace OrientationMonitor with a class existing in your framework.