Xcode 8 syntax highlighting doesn't work Xcode 8 syntax highlighting doesn't work ios ios

Xcode 8 syntax highlighting doesn't work

This answer helped me https://forums.developer.apple.com/thread/46223 with one of my projects:

I got help from an apple engineer at WWDC on this issue and resolved it. The problem stemmed from cocoapods... Apparently cocoapods was copying .h files into the build directory and SourceKit was getting confused. I'm not entirely sure why the .h files were being copied - they aren't needed there. So the fix was to add a post-build script in your build phases section that removes the headers after a build.
It would look something like this:

function removeHeaders() {      find $BUILD_ROOT/Debug-iphonesimulator/  -name '*.h' -exec rm -f {} \;  }  removeHeaders  

Fixed. Problem was related to the presence of target in project which is not compiled. So if you have targets e.g. A, B, C and C is not compiled this cause problems with syntax highlighting.

I have found that when syntax highlighting falls over, switching tabs in Xcode fixes the issue ¯_(ツ)_/¯ sometimes I find I need to switch to at least 4 different tabs before it comes on again.

Otherwise a quit and reopen