Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode is too slow to edit on a large project

Summary: I have a large Xcode project 50 + scenes with some files with a large number of lines. I have separated the scenes into 15 different story boards. Currently it takes 5 minutes to switch to see the compiler errors/warnings. There are approximately 100 swift files in the project. When I am trying to edit a swift file , the editor hangs and the spinning "beachball" appears for minutes. I have deadlines to finish and editing is just impossible...I have tried clearing derived data and clearing caches...cleaning and restarting. This worked for a while but now makes no difference. I appreciate your help.

I have read that certain coding can affect the parsing during editing. How do I find which bit of my code is at fault?

it is taking me minutes to make a change to a parameter

Version/Build: I have installed Xcode 9, although I was having similar problems with Xcode 8

Configuration: I am using a MacBook pro model a1706. 8 gig of Ram, 2.9ghz processor.

like image 968
pilotagm Avatar asked Dec 08 '25 00:12

pilotagm


1 Answers

The following resolved most Xcode 9 beachball issues for me, and perhaps it will help someone else...

Quit Xcode. From the Finder, right-click your project (.xcodeproj) file. Choose "Show Package Contents". Right-click the "project.xcworkspace" item. Choose "Show Package Contents". Open the "xcuserdata" folder, then the ".xcuserdata" folder. Drag the "UserInterfaceState.xcuserstate" item to the desktop (just in case). Delete the "UserInterfaceState.xcuserstate" item. Launch Xcode and open your project.

This resulted in a dramatic performance increase when opening and navigating my large objective-c project (which has 250 xib files, and over 100 source code files). Of course, YMMV.

like image 154
lifjoy Avatar answered Dec 11 '25 00:12

lifjoy