Interface Builder freezes when I add a UIView with a UILabel in place of the title
I have tried disabling Autolayout, removed Storyboard reference from the project and add it back again.
Mac info:
I know I am late to the answer here, but I have been strugling with this problem for a while with Xcode 8 in El capitan having this same issue.
I take no credit for the solution, it goes to sroebert user in apple forums, you can see the original source here (you can Ctrl + f his username to get to his answer).
In my case, the problem presented only in specific nibs, not every nib nor storyboard. For my surprise, changing the Top Bar from Opaque Navigation Bar to Inferred made Xcode and Interface builder responsive once again.
It may or may not help you, but I hope it helps someone.
Related
I am new to programming on the Apple Mac. I have followed a programming guide supplied in the Mac Developer Library to program a basic GUI program called TrackMix. In this program you place a textbox, a vertical slider and a button control on the view window. Initially, on dragging the specific object, say the textbox, to the window, a set of alignment guides (dotted blue lines) would automatically appear on the canvas when the object is dragged over it. I dont know what has happened, but now those guides have disappeared when I execute the same action of dragging objects to the window. When the object being dragged is over the window a small green dot, with a plus sign in it, appears on the bottom of the object. I have carefully retraced my steps to be exactly the same as stated in the Developer Library, but still the problem persist. Have I, perhaps, involuntarily changed some Xcode settings or what? I am at the end of my wits! PS: I am using Xcode 7.
You have to toggle the menu item "Editor > Canvas > Snap To Guides" in Storyboard. I hope that helps
I am not sure whether this will be helpful, but I just had the same problem and the only thing which worked was re-installing Xcode (7.3) and trashing all of the Xcode preferences.
Good luck.
[EDITED] After spending a couple of days on a iPad app (utility s/w for myself; not for release), I accidentally clicked on disabling size classes in Xcode (6.2). I only want to turn off Auto Layout temporarily so I could figure out why my popover scene was not rendering.
Now, all the UI elements are gone but the guidelines for both the main scene and the popover scene are still around. History seemingly shows nothing that will bring back the UI elements. I closed the Xcode project and opened it again, but only the red guidelines are visible.
Has anyone run into this? Any idea how to fix this? [EDIT] I'm referring specifically to the UI elements and getting them all back -- else I'm going to have to spend a couple of hours reconstructing and positioning them. I browsed StackOverflow and Google Search but I've not seen any relevant suggestions.
First, when disabling auto layout it will disable the size classes as well.
I would suggest that you update your Xcode to 6.3. Then that will probably be gone.
Hope that helps :)
Edit
regarding the comment
First off I would print the frames of the UIElements to see whether they are still on the screen. (Using `println("(button.frame)")
Then, if they are not there, change their frames / centres) to somewhere on the screen.
If they are in the bounds, check their sizes to make sure they are large enough to be visible. If they are then make sure they are not hidden and their alpha is 1.
In storyboard you can open the side-bar and then change the element's position in the Attributes inspector as shown here:
I have an problem with Xcode 6 really responding very slowly to user interactions, e.g. editing code, scrolling areas etc. This particularly happens when the interface builder show the view controllers with constraints in the storyboard (4/14 vcs has constraints i just begin the project) additional i use extra monitor.
I'm wondering if there is anything I can do to improve performance changing xcode options or other way.
My development machine is a MacBook Pro Retina (Retina, 15-inch, Late 2013) with 2.3Ghz Intel Core i7 and 16 GB RAM (1600 MHz DDR3), running OSX 10.9.5 (Mavericks).
Do you use an external monitor? If yes, probably that's the problem. Try moving to the main macbook screen and try again.
That solved the problem for me.
EDIT: sorry, just read you have an external monitor. So yes, move to the main screen and check if that solves the problem.
EDIT 2: seems like Apple fixed the problem, no more issues using my external monitor!
EDIT 3: meh! Problem persists, not sure why it stopped happening, and happens again now.
I had this same problem where performance plummeted on an external display.
What I ended up discovering was that the external monitor issue was indicating that there was a UIView that interface builder couldn't quite figure out properly for auto-layout.
In my case it was a UIToolbarBarItem that contained a UIView that contained a UILabel. Once I removed the offending UIToolbarBarItem the performance issue resolved itself. It went from being completely unusable to smooth scrolling.
You should check if you have a UIView inside something that might cause auto-layout to freak out.
Wow, thanks so much guys! I was having a huge problem with Xcode being slowed to a crawl while I was modifying interface elements in the interface editor. All I had to do was uncheck "Use Auto Layout" under the .xib's File Inspector tab, and it's running faster than ever!
So if you have any problems with Xcode's interface editor / Interface Builder being slow, just disable Auto Layout for that .xib while you're working on it, then when you're done editing the .xib, as a final step, re-enable it and add your constraints to the items.
I recently have been working on a project that has a xib file that contains a UIView w/ a UIScrollView inside of it. There is a long list of content within the UIScrollView, and I have noticed a significant decrease in speed while working in the Interface Builder.
All other files work fine and working with the Interface Builder with other files works perfectly. It is only this specific xib file that causes a lag of about 5 seconds after making even basic changes like clicking on a UILabel. I expect that the problem is caused by the amount of objects in the main UIView's UIScrollView.
I first tried restarting everything and then tried the suggestions from this thread: Xcode 4 - slow performance
None of them solved the issue. I have never had a similar problem before. Has anyone dealt with this kind of issue before and solved it?
I have a Late 2011 Macbook Pro w/ a 2.4GHz Intel Core i5 processor and 16GB of RAM.
While the .xib is in Interface Builder, go under the File Inspector tab and disable auto-layout for the .xib, then when you're done, re-enable auto-layout for the .xib and add constraints.
Also answered here: other stackoverflow question
For what's worth. I also had major performance issues with the new Xcode. Slow slower slowest.
I did 2 thing disabled indexing en forced stopped IB.
Disable indexing:
On the command line give the command:
defaults write com.apple.dt.XCode IDEIndexDisable 1
After this, Xode runs good. Although code completion etc will not work.
If you want you can turn it on again with:
defaults delete com.apple.dt.XCode IDEIndexDisable
Force stop of Interface Builder
I found this one by surprise. During one of those awfull moments when IB was doing something / nothing or whatever, I forced stopped Xcode.
Press Alt+Cmd
Select Xcode and press force stop
After that IB runned smoothly!
It is something related to auto layout. Not sure exactly what it is.
My problem was on particular xib.
When cancelling auto layout for that xib performance is smooth. As soon as I turn it on and put constraints on my scroll view (0 margins to all sides), it goes laggy again.
What solved the lags for me was to set navigation bar appearance in interface builder to none (Was opaque).
Strange thing is, it happens only on my Mac Book air 13'. My iMac runs this exact same file smoothly. Not sure if it has something with the hardware or not.
When using the interface builder, if I select a button that is in my layout, the interface builder immediately zooms into that button.
Is there any way I can stop that behaviour.
i.e. I want the interface builder to just select the button and not zoom in.
XCode 4.2 snow Leopard
Post-Script. I think the answer is "you can't". One other suggestion refers to making zoom shortcuts but that does seem to help either.
In response to my own question. As of 24 hours later I think the answer is
"you can't".
One other suggestion found when researching in StackOverFlow refers to making zoom shortcuts but that does seem to help either.