[英]Storyboard is very slow
So I've been working on a project for a while that has so many view controllers, but I notice that now when I try to do a single edit in any view , storyboard hangs, or become unresponsive . 因此,我已经在一个有很多视图控制器的项目上工作了一段时间,但是现在我注意到,当我尝试在任何视图中进行单个编辑时,情节提要挂起或变得无响应。 what would be the solution for this issue ?
该问题的解决方案是什么? is it possible at my current state to split up the whole storyboard into smaller ones ?
在目前的状态下,是否可以将整个故事板拆分成较小的故事板? and will that resolve the problem ?
并能解决问题吗? I'm using Xcode 9.3
我正在使用Xcode 9.3
Yes. 是。 You can have more than one storyboards in one project.
一个项目中可以有多个情节提要。 In fact that's the preferred way to manage very large projects.
实际上,这是管理大型项目的首选方法。 To create more storyboards go to File Menu > New > File... and then select Storyboard from the User Interface section.
要创建更多情节提要,请转到“文件”菜单>“新建”>“文件...”,然后从“用户界面”部分中选择“情节提要”。 Doing this should resolve your issue.
这样做应该可以解决您的问题。 However, if the issue still persist you can consider taking out the specific user interface into its own .xib file.
但是,如果问题仍然存在,则可以考虑将特定的用户界面放入其自己的.xib文件中。
Update: 更新:
If I were in your position I would have considered using .xib files to create my user interface instead of using storyboards. 如果我在您的位置,我会考虑使用.xib文件创建用户界面,而不是使用故事板。 Storyboards do have their advantages but there are some cons too if you use them.
故事板确实有其优点,但如果使用它们,也有一些缺点。 Like:
喜欢:
Yes, it is best practise to distribute viewConrollers into multiple storyboards so that you can open it quickly but it can lead your time to manage each storyboard identification programatically while accessing into code. 是的,最佳实践是将viewConrollers分配到多个情节提要中,以便您可以快速打开它,但它可能会导致您花费时间在访问代码时以编程方式管理每个情节提要标识。
Otherwise, you can set storyboard View as : iPhone 5C so that it can load little bit faster than bigger devices. 否则,您可以将情节提要板View设置为:iPhone 5C,这样它可以比大型设备快一点的加载速度。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.