加快故事板打开速度 [英] Speed Up Storyboard Opening

查看:31
本文介绍了加快故事板打开速度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我打开故事板文件时,由于其中包含的 VC 数量太多,需要 1-2 分钟才能打开.加快速度的最佳做法是什么?我们应该将一些 VC 移动到不同的故事板文件中吗?我们是否应该使用更多的 xib 文件来减少 VC 中的元素数量?任何关于我们可能实施的不良做法使故事板加载时间如此缓慢的建议都会很好.

When I open the storyboard file, it takes between 1-2 minutes to open because of the number of VCs I have in it. What is the best practice to speed it up? Should we move some VCs into different storyboard files? Should we use more xib files to reduce the number of elements in VCs? Any suggestions would be great on what poor practices we might have implemented to make the storyboard loading time so slow.

推荐答案

良好做法:

  1. 将您的 ViewControllers 保存在不同的 storyboard 中,这些 storyboard 在逻辑上彼此不相关.它会
    大大减少故事板渲染/打开时间.它也会使用
    时避免故事板中的冲突非常有帮助团队.
  2. 尝试将 UI 元素添加到 xib 文件中,例如 tableViewCellcollectionViewCellbuttons
  3. 尝试使用代码而不是 IBInspectable/IBDesignable 来自定义 UI 对象.
  1. Keep your ViewControllers in different storyboard which are not logically related to each other. It will
    considerably reduce story board rendering/opening time. It will also very helpful to avoid conflicts in storyboard when working with
    teams.
  2. Try to UI elements to xib file, like tableViewCell, collectionViewCell, buttons, etc
  3. Try to customise UI objects using code rather than IBInspectable/IBDesignable.

不良做法:

  1. 将所有视图控制器保存在单个故事板文件中.因为渲染故事板文件中的所有 UI 对象及其在故事板中的位置需要很多时间.

谢谢

这篇关于加快故事板打开速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆