Xcode 9 Autocomplete Not Working 100% - Partially Working Xcode 9 Autocomplete Not Working 100% - Partially Working xcode xcode

Xcode 9 Autocomplete Not Working 100% - Partially Working


Try:

  1. Go to Xcode > Preferences > Text Editing
  2. Under Code completion - Uncheck 'Suggest completions while typing'
  3. Quit out of Xcode and then relaunch Xcode.
  4. Go to Xcode > Preferences > Text Editing again
  5. Quit out of Xcode and then relaunch Xcode.
  6. Now go to Code completion and check 'Suggest completions while typing'.
  7. Try typing library function or enum and enjoy!


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


Things to try:#1Run this command in the project directory if you use cocoapods:

rm -rf ~/Library/Caches/CocoaPods;rm -rf Pods; rm -rf ~/Library/Developer/Xcode/DerivedData/*;pod deintegrate; pod setup; pod install;

#2**Clean Cached Data**

Clean the Project -> Cmd+Shift+K

Clean the Build Folder -> Cmd+Shift+Option+K

If you skipped step one:
Delete Derived Data
Xcode Preferences -> Locations ->
Arrow Symbol Takes you to DerrivedData -> Delete Folder


#3**Check your Build Phase's Compile Sources.**

Every .swift and .m file in the project should be in this list or it won't autocomplete in those files.


#4**Optimize your Editor:**

Use fileprivate* on every class property and function that you can to reduce the scope of the Compilers work per item.

Write modular/OOP code so you have less code for the compiler to read.

Avoid using Type Inferance when the result is a complex calculation, and try to break down complex calculations into let this = smallerOperation statements

* In Swift 4 private became stricter than fileprivate


In Xcode 12 there have been significant improvements in how often deleting derived data is necessary (though freezing has increased).