Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 6 isn't autocompleting in Swift

I am trying to import various libraries which I can't remember their exact name. Unfortunately Xcode 6 (using swift) isn't auto completing them like was done in Xcode 5 using objective-c.

For instance:

ALAssetsLibrary MPMediaPlayer 

etc.

I am forced to Google the exact framework name and then go back and copy paste.

In general autocomplete is working very poorly. Am I doing something wrong in Xcode 6?

Should I set any flags in settings to get it to work?

like image 901
Avner Barr Avatar asked Aug 05 '14 07:08

Avner Barr


2 Answers

This fix from apple dev forums works for me. I have had performance/autocomplete issues since beta 5 i think and now xcode 6.1/Yosemite on my old 2010 MBP is working flawlessly.

  1. Quit Xcode.
  2. Restart the computer (this is to clear any in-memory caches).  
  3. Delete the contents of the DerivedData folder (~/Library/Developer/Xcode/DerivedData)
  4. [This is the key move:] Delete ~/Library/Caches/com.apple.dt.Xcode.

Now launch Xcode once more…

like image 135
bWlrYWphdWhvbmVu Avatar answered Nov 15 '22 19:11

bWlrYWphdWhvbmVu


This is the same as the correctly chosen answer above but just made slightly easier.

I've had to do it several times and in my testing you can skip restarting your mac.

1) Close Xcode

2) Terminal -> rm -rf ~/Library/Developer/Xcode/DerivedData/*

3) Terminal -> rm -rf ~/Library/Caches/com.apple.dt.Xcode

Restart Xcode and it should be back to normal.

like image 31
Travis M. Avatar answered Nov 15 '22 18:11

Travis M.