Xcode 6 isn't autocompleting in Swift

前端 未结 10 816
清酒与你
清酒与你 2020-11-29 15:57

I am trying to import various libraries which I can\'t remember their exact name. Unfortunately Xcode 6 (using swift) isn\'t auto completing th

10条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-29 16:35

    I find this extremely annoying. Posted answer to clear derived data works bulletproof, however you should close xcode before clearing folder. I've made small script to do the work for me.

    #!/bin/bash
    
    echo "Start fixing xCode"
    echo "Closing xCode"
    osascript -e 'tell app "Xcode" to quit'
    sleep 2
    echo "Clearing DerivedData..."
    rm -rf "$HOME/Library/Developer/Xcode/DerivedData"
    sleep 2
    echo "Launch xCode again"
    osascript -e 'tell app "Xcode" to run'
    echo "Finish fixing xCode"
    

    Now whenever xCode gives me a finger I simply run it. The problem that you need to recompile everything however still persists.

    EDIT

    Thanks to on suggestion in the comments from @Nikolay Spassov, I adjusted the script to capture your home directory instead of changing it. So below step is no longer neccessary.

    OLD Step

    Please note you have to change '/Users/iphonedev5...' part to make it work in your system :)

提交回复
热议问题