CodexBloom - Programming Q&A Platform

how to to Load Custom Fonts in Objective-C on iOS 16 - Font Not Found scenarios

👀 Views: 68 💬 Answers: 1 📅 Created: 2025-06-13
ios objective-c fonts xcode Objective-C

I'm updating my dependencies and Hey everyone, I'm running into an issue that's driving me crazy. I'm trying to load custom fonts in my iOS app, which has been working perfectly until I updated to iOS 16. Now, I'm working with the behavior: `Font 'MyCustomFont' not found`. I've added the font files to my project and included the proper entries in the Info.plist under `UIAppFonts`. Here's how my Info.plist looks: ```xml <key>UIAppFonts</key> <array> <string>MyCustomFont.ttf</string> <string>AnotherFont.ttf</string> </array> ``` In my code, I'm attempting to set the font in a UILabel like this: ```objective-c self.myLabel.font = [UIFont fontWithName:@"MyCustomFont" size:17.0]; ``` Despite confirming that the font files are included in the build and checking their target membership, the behavior continues. I've also tried cleaning the build folder and deleting the app from the simulator/device, but that hasn’t helped. Is there something new in iOS 16 that I might be missing, or any specific steps I should be taking to ensure the fonts are loaded correctly? Any insights would be greatly appreciated. Any help would be greatly appreciated! This is part of a larger web app I'm building. This issue appeared after updating to Objective-C 3.10. Is this even possible?