I've recently added many language localizations (localizable strings) to an Xcode (7.3.1) project.
Since around that time, working with the storyboards in Xcode has been incredibly difficult, and Xcode at times has been very unresponsive. Typically when working with storyboards the mouse turns into a colorful spinning pinwheel for about 5 seconds, then I get a few seconds where I can work, until the spinning pinwheel shows up for another 5 seconds again.
When editing swift code, where code is the only window onscreen, this issue doesn't seem to occur, the issue only seems to occur when editing the storyboard and only ever since it seems after adding localizations.
In fresh new projects, projects with no localizations, there are no such issues, project storyboards can easily be edited with no long interrupting pauses.
I've tried deleting the Derived Data folder and that didn't improve things. I'm considering removing all localizations and putting them back in at the end of the project, but this doesn't seem efficient to do either.
1 - Is there a way to disable localizations without deleting them in the project?
2 - Is there a way to remove localizations and then drop them back into the project at a later date efficiently? (When I say efficiently I mean easily such as drag and drop as opposed to adding them back in via multiple menus and dialogue boxes.)
3 - Any suggestions as to what might be going on here with this unique Xcode behavior?
Thanks.
2 -
delete the files by reference, and add them later (File>Add Files)
3 - When storyboards contains so many things, it will take time to load. Its good practice to use multiple storyboards which contains specific modules. So it will be readable and will load faster.
This might also help:
If you use ios8 and above you can use storyboard references
just watch out for ios8 limitation
To improve loading or reduce loading frequently, select your storyboard, press Edit, and deselect Automatically Refresh Views
Related
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.
I am running a MacBook Pro with an i9, 16 GB ram, and the AMD Raedon Pro 5500M (I have tried disabling integrated graphics)
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.
Here's what I have tried:
Disabling integrated graphics
Re-cloning
Refactoring views into their own 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. 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.
Also, do you have many view controllers in your storyboard. A good practice is to have only one controller per storyboard to limit these side effects. (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. 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
2.Break the storyboard into small storyboards
3.Remove hardcoded large size image on storyboard
4.Update Xcode
I am porting app code from another language and tool that already fully manages all logic for switching views.
The app will probably have about 10 unique scenes for now, but most likely just grow and grow over time :)
It appears the default now is to mash it all together in one big storyboard and code file and use builtin mechanism for swiching scenes.
As I am new to iOS/Swift/Xcode I am not sure what long-term feasibility is of these solutions:
Create unique storyboatd for each scene containing only one scene and switch manually
Create a nib? single scene for each scene and switch manually
Put everything together in one big storyboard and swich manually
My worries about putting everything together are at this point these:
App startup time
Xcode slugginish if it has to show 10+ scenes at the same time in the storyboard
What apple recommends is to use Storyboard, and simply switch between Views using segues just ctrl+Drag between views to create a segue and then call programmatically.
apple developer reference: Using segues
Nothing is sluggish you can use as many views per storyboard as you want. if there is like 25 views, xcode maybe become slow somehow.
Enjoy
It's kind of subjective, but:
App startup time
This is a non-issue. Storyboards are compiled down to XIBs so they're about the same as using NIBs performance-wise. And NIBs are plenty fast enough for most use cases.
Xcode slugginish if it has to show 10+ scenes at the same time in the storyboard
Not really. My Macbook is six years old and I have Storyboards with far more than ten screens. I find screen real-estate to be a far bigger issue than performance. With Xcode 7 you can also use multiple Storboards and link them together.
I am developing iOS app. I have more number of view controller in the storyboard. When i build the app for first time it takes longer time for loading (nearly 30 mins). After the first build it takes lesser time to build the app. and also if i made any changes in the storyboard then the app takes longer time to build the app(nearly 30 mins). My app size is 33 MB. I can’t figure it out where the problem arise . I think the problem is in the storyboard that i am using more number of view controller in the storyboard.
It sounds like you have put too many viewcontrollers in your storyboard. If the storyboard isnt touched after a build, it wont have to recompile a lot of things to do with it again. If it is touched it will have to recompile the whole thing. If you separate out sections to different storyboards you shouldnt feel these effects as much.
A first time build will always be the longest though as it will be compiling from scratch and wont be able to reuse already compiled sections of the program
Fonix is right. You need to bifurcate your storyboard, or maybe divide-into-multiple even. Editing anything on the storyboards forces it to recompile it to run.
Follow the best practices for storyboards mentioned here.
I think Fonix is right. If your app still takes longtime to build. There maybe something wrong on your computer. I meant the same problem with you. And try many methods, but it does not work. Finally I Found my computer`s disk had bad tracks
My Xcode project using a storyboard entered in a very weird state recently: Xcode keeps building the whole project and notably the storyboard after each keypress. I found no reason for this behavior neither in my project diffing all interesting files (storyboard and project) neither a setting in Xcode (maybe I just could not find it?) Needless to say that this "feature" makes working on my project nearly impossible since the CPU is constantly occupying with rebuilding the storyboard when I type new code. Anybody seen this?
It is caused by the IB_DESIGNABLE definitions in the source header files. Probably it makes problem only if the header file containing IB_DESIGNABLE is included (even implicitly) to the source file you are currently editing.
I did not find a definitive solution how to disable IB_DESIGNABLE and thus compiling the storyboard and the source files continuously. I would appreciate an Xcode flag to disable this temporarily. I tried also surrounding the IB_DESIGNABLE with #ifdef macros but they are considered even if the #ifdef evaluates to false. Commenting out one by one the IB_DESIGNABLE helps but it is not a feasible solution with many IB_DESIGNABLEs.
Update
I finally found a quick way to avoid this annoying behavior. Having the storyboard opened in the active window, disable "Automatically Refresh Views" from the Editor menu. This will stop updating the views in the storyboard editor that use your custom code and thus speed up your development significantly. When you need again the just-in-time compiling to have a visual preview of your custom code, enable this option again (it seems you also have to re-open your storyboard to make it working again).
You may wish to add a key binding to the command, such as command-option-control-A, to easily toggle the behavior on/off. To add a key binding in Xcode, touch command-comma for preferences, choose the Key Bindings tab, use the search bar to find the command, then double-click on the right area to add your desired keystroke.
"Leave it off" approach
Alternately turn "Automatically Refresh Views" off, and never turn it on.
Make a convenient keystroke for "Refresh all views", say command-option-shift-R
As you work, just touch command-option-shift-R from time to time, or as needed. It's generally only necessary to touch command-option-shift-R as you work on the storyboard.
I had this problem and the accepted answer did not work for me.
The problem I had was that I always keep the storyboard open in it's own tab within XCode so that I can access it quickly.
The only way I could fix it was to either close that tab or select a different file (like a normal code file) and then close and reopen XCode. Thereafter it was no longer rebuilding on each keystroke.
Be warned however if you need to open the storyboard to make changes then this problem can sometimes reappear and I will have to repeat the above process.
Can't wait till Apple fixes this as it is very frustrating indeed!
(ノಠ益ಠ)ノ彡┻━┻
I have a project in xCode 6 using Swift (my very first experience developing iOS Apps).
I was having problems with gestures (they are alive even after removing them from storyboard) and decide to delete the ViewController I was having problem. The program compiled as it still exists. Then I decide to delete and remove reference to file main.storyboard and everything works just as before.
I believe that is related to source control
Where are those view controllers and even the storyboard stored?
By using the storyboard, sometimes you are creating some link between your elements and/or some part of your code.
These links will still be, even after deleting the element unless you delete the link itself.
In order to perform good deletion, you should first right click on the element you want to delete and suppress all its links. Then you can safely delete your element: