Xcode 6 Isn't Autocompleting in Swift

Xcode 6 isn't autocompleting in Swift

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…

Xcode 6 Swift code completion not working

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

Xcode 6 autocomplete failure ( error type )

I was about to give up and work without the autocomplete feature, I even reinstalled XCode but with no success. What I forgot to try was to delete the .xcuserdatad folder that can be found when you right click on the project and select the Show Package Contents, then open xcuserdata folder and delete the [Username].xcuserdatad folder. It worked like a charm, the autocomplete is "alive" again and XCode works better than ever before. I hope this would help anyone with the same annoying issue...

Xcode 6.1 swift autocomplete and code sense broken

I have had the same issue for many days while working in swift, finally I have deleted some old data in the directory ~/Library/Developer/Xcode/DerivedData and started the xcode again and error is disappeared.

Hope it helps!

Xcode 9 Autocomplete Not Working 100% - Partially Working

Deleting the DERIVED DATA folder seemed to fix my issue. Thanks to this post: swift println() not showing autocomplete options while writting code

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.

In Xcode 7, Swift can't autocomplete Objective-C code

I think I figured this one out:

Our project has multiple targets, and most of the files belong to multiple targets. If you want autocompletion, the header you are importing has to be imported in the bridging header for every target the file belongs to.

When I imported the header I wanted in each bridging header, autocompletion started working as expected.

Update: Seems like you can consolidate down to one bridging header if that setup works for your project. That would prevent you having to update multiple headers every time you wanted to add an import.



Related Topics



Leave a reply



Submit