Last Updated: September 09, 2019
·
5.027K
· iankitshah

XCode: View TODO, FIXME, Custom Tags as warning

As a android/java developer I am familiar with "Eclipse IDE" a lot, recently started iOS development and in "XCode IDE" I misses (or not aware) several options/capabilities that eclipse has - one of them is Tasks View which list out all TODO, FIXME, custom tags at common place...

In XCode you can add script to view all your //TODO: and //FIXME: comments at common place... It may not be best approach but I found it useful...

It will display all tags/comments as compiler warnings when you build project.

Instructions:
1. Select your project in the Project Navigator
2. Open the target in the sidebar and move to the "Build Phases" tab
3. Click on "Add Build Phase"
4. Add below script to "Run Script"

KEYWORDS="TODO:|FIXME:|DevTeam:|XXX:"
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | perl -p -e "s/($KEYWORDS)/ warning: \$1/"

Picture

1 Response
Add your response

@epologee Uploaded screenshot - hope this helps...

over 1 year ago ·