自定义视图非常慢(Custom View is very slow)

在iOS8-Xcode7.1-Swift2.1上,自定义UIView非常慢。

在iOS9上并不慢。

我已经通过Time Profilier检查了上述内容。

'super.init(编码器:aDecoder)'耗时2秒。

我附上Time Profilier截图。

但我从来没有遇到过这样的情况。

这是什么问题?

On iOS8-Xcode7.1-Swift2.1,Custom UIView is very slow.

On iOS9 is not slow.

I have checked the above things by Time Profilier.

'super.init(coder: aDecoder)' took 2 seconds.

I attached Time Profilier capture.

But i never experienced such a situation.

What is this problem?

最满意答案

我可以通过@David Wong的暗示来解决这个问题。 谢谢。

iOS8和iOS9的字体列表不同。 'HiraginoSans'可从iOS9获得。 如果iOS8尝试使用此字体,则设备必须首先下载。 这就是为什么视图负载非常慢的负载。

Mac在FontBook上有Font系列。 我可以通过将以上字体导入到xcode项目来重新实现它。

谢谢。

I could reslove this problem by a hint of @David Wong. Thank you.

Font list is differnt between iOS8 and iOS9. 'HiraginoSans' is available from iOS9. If iOS8 try to use this font,device have to download at first. That's why view load is very slow loading.

Mac has Font family on FontBook. I could resove it by importing above font to xcode project.

Thank you.

更多推荐