Xcode 6.3 Code Completion Too Slow

Xcode 6 with Swift super slow typing and autocompletion


  • Quit Xcode and restart the Mac are not required but preferred.
  • Delete the content of the folder
    ~/Library/Developer/Xcode/DerivedData
  • Delete the content ~/Library/Caches/com.apple.dt.Xcode

This is a temporally solution, but works greatly.

Below the script using Script Editor app.

tell application "Terminal"
do script "rm -frd ~/Library/Developer/Xcode/DerivedData/*"
do script "rm -frd ~/Library/Caches/com.apple.dt.Xcode/*"
end tell

Alternatively, you can create an alias for your terminal like this:

alias xcodeclean="rm -frd ~/Library/Developer/Xcode/DerivedData/* && rm -frd ~/Library/Caches/com.apple.dt.Xcode/*"

You can add that to your ~/.bash_profile and then type xcodeclean on the command line every time you would like to clear those two folders.

XCode is very slow to suggest autocompletion

I have a shiny new iMac at work for development. It's an i7 proc, 8 GB memory. Indexing (and the things that go with it, like code sense or quick documentation) was taking a very long time (5 minutes for ~600 files). So was compilation.

The culprit turned out to be the corporate antivirus' on-access scan. I disabled on-access scanning and indexing dropped to around 5 seconds for the same number of files. Might be worth a shot if you have permissions to change antivirus settings.

Big Swift class results in slow autocomplete inside Xcode - How to split into several files

You've essentially answered your own question with the extension's that don't require the use of inheritance or subclasses.

With extensions you can move code to other files and still access everything is your original ViewController class as if it was within the same file.

Example:

class viewController : NSViewController {


}

// new file
extension viewController {

}


Related Topics



Leave a reply



Submit