故事板中的视图太多 - Xcode运行缓慢 [英] Too many views in storyboard - Xcode running Slow

查看:370
本文介绍了故事板中的视图太多 - Xcode运行缓慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在帮助某人使用xcode项目,但这几乎是不可能的。他们的故事板上有大约100个View控制器,它运行速度非常慢。我已经遵循了所有关于使Xcode更快的指南,但他们对这种情况没有帮助。在那个故事板之外,当我们在.h和.m文件中工作时,它运行得非常好,它只是在故事板内运行缓慢。
有没有人对这样的项目有过任何经验?你做了什么?或者我该怎么做才能在故事板中工作?
谢谢

I'm helping someone out with an xcode project but it's almost impossible. They have around 100 View controllers on their storyboard and it's just running really slow. I've followed all of the guides on making Xcode faster but they just don't help for this situation. Outside of that storyboard, when we're working in the .h and .m files it runs perfectly fine, it's just inside the storyboard that it runs slow. Has anyone had any experience with a project like this? What did you do? Or what can I do to make it possible to work in the storyboard? Thanks

推荐答案

我在使用企业应用程序时遇到了同样的问题。在项目中,我只有一个故事板以及单个故事板中的所有视图。打开故事板导致Xcode变得非常慢。

I faced the same issue when I was working on an Enterprise App. In the Project I had only one storyboard and all views in a single storyboard. Opening the storyboard caused Xcode to get very slow.

所以我将故事板分成多个故事板作为模块方式,并为每个模块加载一个单独的故事板,如下面的代码所示:

So I divided the storyboard into multiple storyboards as module-wise and load a separate storyboard per module like in the code below:

如果我想推送一个视图控制器:

If I want to push a view controller:

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"storyboardName" 
                                                     bundle:nil];
UIViewController *viewController = 
 [storyboard instantiateViewControllerWithIdentifier:@"Members_ViewController"];

[self.navigationController pushViewController:viewController animated:YES];

这篇关于故事板中的视图太多 - Xcode运行缓慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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