I\'m creating an ios framework with its bundle for packaging ressources (nib, images, fonts) and I\'m trying to embed a custom font
You can use this extension if you have the font in a file/bundle.
public extension UIFont {
static func register(from url: URL) throws {
if !FileManager.default.fileExists(atPath: url.path) {
throw VError.incorrectFont
}
var error: Unmanaged?
guard CTFontManagerRegisterFontsForURL(url as CFURL, .process, &error) else {
throw error!.takeUnretainedValue()
}
}
}