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.
Related
Am using Xcode 9.1 and my Xcode error while dragging objects from object panel in storyboard its mirroring automatically as shown in picture .need help in solving this !
Very odd. At first I thought it was simply rendering for a RtL locale but I don't imagine the chrome around the rendered view should be mirrored as well. Out of curiosity are you testing a Right-to-Left locale? If so, does this persist when that preference is disabled?
Otherwise I'd try cleaning the project, restarting Xcode, and removing your .xcuserdatad file, in that order.
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.
[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 have OpenGL application with UITextField in the main menu. When I tap on the text field the keyboard appears and I can edit the text. But if I running under iOS 5 and if I try to split keyboard then the keyboard starts splitting (I mean animation) and then hangs when I release my fingers. I mean it hangs on half splitting - and does not responds more. But my app is still alive - and render is working well - background animation is still working.
I have just made a simple test - have disabled the render at all. And the problem has gone. So the problem is related to OpenGL.
I use OpenGL ES 1.1,
XCode 4.2 and iOS SDK 5.0.
Do somebody have similar problems? Any suggestions?
Please help.
UPDATE:
I have just tested two more games from AppStore - and in one I have found this problem too!
'Roads of Rome HD free' - iPad game.
I've encountered this problem too, but I was able to fix it due to previous experiences. In one application we found that if we keep our GL view active while playing video, the video playback position slider didn't behave smoothly. The same seems to happen with the keyboard split. If your problem is the same as mine, the issue is related to the keyboard split animation not finishing (and, in our case, the point where remained struck varied with each test)
We solved the issue stopping the animation on your GL view (I bet it's called EAGLView) when receiving a UIKeyboardWillChangeFrame notification and starting it again after UIKeyboardDidChangeFrame.
Old post, but I just came across this problem in ios 8 on an iPad3.
Running an OpenGL app at 60fps seems to throttle the keyboard update. Reducing your FPS while the keyboard overlay is active will fix the issue.
I'm using GLKViewController to manage the update and Draw callbacks with a 60fps refresh, but that was causing the keyboard split to lock up half completed.
I found the best solution for me was to set the view's preferredFramesPerSecond to 20 while receiving text input, and then set back to 60 after the textView is closed. As well as fixing the keyboard hang, it also just makes the keyboard generally more responsive.
myViewController.preferredFramesPerSecond = 20;