Speed Up Storyboard Opening

爱⌒轻易说出口 提交于 2019-12-10 11:28:19

问题


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:


Good practice:

  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.

Bad practice:

  1. Keeping all viewControllers in single storyboard file. Because it will take much time to render all UI objects in storyboard file, and its position in storyboard.

Thanks




回答2:


Please open two tab by using command + T in your Xcode, one for ViewController and other for storyboard. It will speed up your storyboard because by opening two tabs, ViewController and storyboard files are already loaded. For more help, Please see the attached image below.



来源:https://stackoverflow.com/questions/44125590/speed-up-storyboard-opening

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!