Xcode 8 syntax highlighting doesn't work

前端 未结 9 631
情歌与酒
情歌与酒 2020-12-25 14:11

The code above has correct syntax highlighting in Xcode 7. It is mix of Obj-C + Swift:

I\'ve updated project to support

9条回答
  •  南方客
    南方客 (楼主)
    2020-12-25 14:16

    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  
    

提交回复
热议问题