So I created a cocoa-pod
and successfully added a font to it. When I run pod install
in the consuming project, it pulls in the fonts. I'm even able to use the fonts in the storyboard. However when I try to access the font either directly in the consuming project or in the pod via UIFont(name: "my-fonts-name", size: 20)!
the font initializer returns nil.
The font is ".ttf"
file extension.
I have done the following:
- The font is in my pod's file structure and finder structure.
- My font has its pod listed as a target member.
- My fonts are in build phases -> Bundle Resources.
- My font name/s are in my plist.
I also tried running:
UIFont.familyNames.forEach({ familyName in
let fontNames = UIFont.fontNames(forFamilyName: familyName)
print(familyName, fontNames)
})
and nothing resembling my custom font was not printed.
I am then getting "The file “PPUIElementModules91.framework” couldn’t be opened because you don’t have permission to view it."
I don't have permission to access the very pod I created. I have gone through all the answers here one by one but none worked.