swift 中沒法使用#Warning
來提示警告, 可以通過給TODO:
FIXME:
加上警告, 實現(xiàn)類似的效果.
Build Phases ---> Run Script ---> add a new Build Phases ---> new run script phase
TAGS="TODO:|FIXME:"
echo "searching ${SRCROOT} for ${TAGS}"
find "${SRCROOT}" \( -name "*.swift" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$" | perl -p -e "s/($TAGS)/ warning: \$1/"
如圖: