简体   繁体   English

XCode 13: Storyboard 编辑时非常慢

[英]XCode 13: Storyboard very slow when edited

I've just cloned a repo from GitHub into my Xcode project and for some reason after a few minutes, my storyboard became incredibly unresponsive and slow.我刚刚将来自 GitHub 的 repo 克隆到我的 Xcode 项目中,由于某种原因,几分钟后,我的 storyboard 变得非常无响应且缓慢。

I am running a MacBook Pro with an i9 , 16 GB ram, and the AMD Raedon Pro 5500M (I have tried disabling integrated graphics)我正在运行带有i9、16 GB内存和AMD Raedon Pro 5500M的 MacBook Pro(我尝试禁用集成显卡)

Everything I have seen online tells me to delete xcuserdata and xcshared data but I cannot do this as I am working on a project which uses source control and server-side building and from what I've read doing this breaks the source control.我在网上看到的所有内容都告诉我删除 xcuserdata 和 xcshared 数据,但我不能这样做,因为我正在处理一个使用源代码控制和服务器端构建的项目,并且从我读到的内容来看,这样做会破坏源代码控制。

Here's what I have tried:这是我尝试过的:

  • Disabling integrated graphics禁用集成显卡
  • Re-cloning重新克隆
  • Refactoring views into their own storyboard.将视图重构为自己的 storyboard。

Any help is appreciated as I'm very fed up with this.感谢任何帮助,因为我对此感到非常厌倦。

Unfortunately if you can't get rid of xcuserdata and xcshared you are a bit limited.不幸的是,如果您无法摆脱 xcuserdata 和 xcshared,那么您将受到一些限制。 I would still try and delete them to see if it helps speed up these (you can always revert).我仍然会尝试删除它们,看看它是否有助于加快这些速度(你总是可以恢复)。 If they are to blame at least you know who to blame for your problems.如果要责怪他们,至少你知道应该为你的问题责备谁。

Other than that I can recommend to look for things that slow down storyboards.除此之外,我可以建议寻找减慢情节提要的东西。 Like @IBDesignables which were invented by a demon.就像恶魔发明的@IBDesignables。

Also, do you have many view controllers in your storyboard.另外,您的 storyboard 中是否有许多视图控制器。 A good practice is to have only one controller per storyboard to limit these side effects.一个好的做法是每个 storyboard 只有一个 controller 以限制这些副作用。 (or none at all if you want to live long and healthy). (如果您想长寿健康,则根本没有)。 You can refactor these out of your main storyboard to try and locate what is slowing it down.您可以从您的主要 storyboard 中重构这些,以尝试找出导致它变慢的原因。 And additionally refactor custom views out of it into full code classes.并且另外将自定义视图重构为完整的代码类。

Wish I could be of more help.希望我能提供更多帮助。

1.Check iCloud storage and status if your project in iCloud shared Documents 1.如果您的项目在 iCloud 共享文档中,请检查 iCloud 存储和状态

2.Break the storyboard into small storyboards 2.将storyboard分解成小故事板

3.Remove hardcoded large size image on storyboard 3.删除storyboard上硬编码的大尺寸图片

4.Update Xcode 4.更新Xcode

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM