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
Found a really easy and readable way to register font, which is not mentioned here:
func registerFont(with fontName: String) {
guard let url = Bundle(for: BundleToken.self).url(forResource: fontName, withExtension: nil),
CTFontManagerRegisterFontsForURL(url as CFURL, .process, nil) else {
fatalError("Failed to register font: \(font.fileName)")
}
}
private final class BundleToken {}