Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xib taking long time (>1s) to load. UIFont cache seems to blame

I have a UIVC loading from a Storyboard which, in turn, loads a Xib. This inner load is causing the VC to take more than a second to load. There is some fancy footwork going on in the inner xib (it loads another xib which has dynamic drawing) but this doesn't appear to be the bottleneck.

According to Instruments, UIFont -initWithCoder is the culprit. (If you drill down further TBaseFont::CopyLocalizedName() is the deepest entry that accounts for the majority of the 1s time)

I'm a bit stumped as the custom font I use occurs all throughout the app with no problems. Any ideas?

Screenshot from Instruments

like image 820
Hari Honor Avatar asked Jun 09 '15 14:06

Hari Honor


1 Answers

Ok the problem was that the custom font was no longer embedded in the app. I had switched to another similar one which looked the same. Weird though as I'd have expected those offending labels to revert back the System font on the device but they did not. Is it possible they were being pulled from the Macbook?

like image 68
Hari Honor Avatar answered Nov 09 '22 00:11

Hari Honor