Can I preload custom fonts on iPhone for better performance?

I added an entry UIAppFontsto my info.plist to include custom ttf fonts, it works fine. However, when using a font, there is also a delay in the UIView on the first call, is there a way to preload the fonts or some other method to avoid this?

thank

+5
source share
1 answer

In the application’s deletion or other place that is called when the application starts, try to create a hidden UILabel that uses your own font and immediately removes it. Thus, it will preload the font so that the next time you use UILabel with this font, it will not pay the first time.

+1
source

All Articles