Xcode 6 Swift code completion not working
Using Xcode 6 GM seed my code completion has stopped working. It was working the other day. I was trying to get the unwind segue work around to work. I had made an Objc header file and assigned it as a header for a Swift class.
At this point I get code completion with an Objective-c project. But, not with a Swift project.
I have tried restarting Xcode, making a new empty project.
Solution 1:
Just go in user->Library->Developer->Xcode->DerivedData
and delete the Data of folder(Derived data) and restart Xcode.
Solution 2:
This fix from apple dev forums works for me. I have had autocomplete issues with Xcode 6.1/Yosemite.
- Quit Xcode.
- Restart the computer (this is to clear any in-memory caches).
- Delete the contents of the DerivedData folder (~/Library/Developer/Xcode/DerivedData), precisely run, a) cd ~/Library/Developer/Xcode/DerivedData/
b) rm -rf *
- (Try this if Steps 1-3 dont really work as it rebuilds the cache later on restart which takes time) Delete the contents of folder ~/Library/Caches/com.apple.dt.Xcode, i.e.,
a) cd ~/Library/Caches/com.apple.dt.Xcode
b) rm -rf *
Now launch Xcode once more…
Solution 3:
I experienced a serious breakdown of code completion because I had some 'notes' after the @end statement of my .m file which were as follows:
/*
NSAlertFirstButtonReturn, NSAlertSecondButtonReturn, NSAlertThirdButtonReturn
*/
These lines can appear before the @end statement without destroying code completion.
Solution 4:
There's an easier way to delete the Derived Data from within Xcode (no need to open finder or restart):
Xcode Organizer -> Projects -> (Your Project) -> Delete Derived Data
Solution 5:
I just recently had this problem. Autocomplete did not work ...and when i typed for example tableView.... it did not give me the different functions available.
I tried the following and it worked for me.
Xcode Organizer -> Projects -> (Your Project) -> Delete Derived Data
delete the file ~/Library/Developer/Xcode/DerivedData/ModuleCache
Restart xcode
Hope this works