target->Build Phases->add Run Script
添加一下脚本,在程序中使用 //TODO: 或者//FIXME: ,将生成一条warning,也可自己定义warning标签
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/"