Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 976
Mitchell Hudson Avatar asked Sep 17 '14 06:09

Mitchell Hudson


People also ask

Does Xcode have code completion?

Using Code completion in XcodeOnce enabled, Xcode will now offer code completion based on what you have typed and offer suggestions for completing the syntax.

How do I run a swift code in Xcode?

Note: On OSX Yosemite and Xcode 6.1 and above you can run the Swift Compiler by just typing swiftc in the command line. The Swift Compiler is what compiles your Swift code to binary, and it's called swiftc. Now compile and run hello. swift.

How do I get suggestions in Xcode?

Press the escape key when auto-complete makes the first suggestion. This will display the list. Escape or control-comma will show the list, control-period will accept the current suggestion and (subsequently) rotate through suggestions, control-slash will move to the next placeholder argument that was inserted.


2 Answers

Just go in user->Library->Developer->Xcode->DerivedData and delete the Data of folder(Derived data) and restart Xcode.

like image 83
Ali Raza Avatar answered Sep 19 '22 17:09

Ali Raza


This fix from apple dev forums works for me. I have had autocomplete issues with Xcode 6.1/Yosemite.

  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), precisely run, a) cd ~/Library/Developer/Xcode/DerivedData/
    b) rm -rf *

  1. (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…

like image 41
Anuj Avatar answered Sep 17 '22 17:09

Anuj