Swift: #warning equivalent

前端 未结 14 1665
無奈伤痛
無奈伤痛 2020-11-28 18:52

Does Swift have a #warning equivalent? It\'s simply used to show a warning in Xcode\'s own GUI

I\'m also interested in whether there\'s a #error equivalent.

14条回答
  •  难免孤独
    2020-11-28 19:00

    Advantage of this snippet - it doesn't show warnings from Pods:

    if [ "${CONFIGURATION}" = "DEBUG" ]; then 
        TAGS="TODO:|FIXME:|WARNING:|warning:" find "." \( -name "*.swift" \) -not -path "./Pods/*" -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$" | perl -p -e "s/($TAGS)/ warning: \$1/"
    fi
    

    How to install:

提交回复
热议问题