Contact Us

Use the form on the right to contact us.

You can edit the text in this area, and change where the contact form on the right submits to, by entering edit mode using the modes on the bottom right. 


Oak Ridge, TN, 37830
United States

Swift-Snips

TODO and FIXIT to the Forefront of XCODE

Wade Cantley

The problem I ran into was that I wanted a way to organize the TODOs across the various files I was creating.  

There was one plugin that I found but the common plugin manager seemed to be out of date and the manual way to install this plugin seemed a little bit hinkey.

But I stumbled upon this great way to use XCode to highlight TODOs  using the warning system.  Here is the rundown of how that works.


First, you want to go to your project settings by clicking on your project name.  After that, click on the application target and select "Build Phases".  You will need to add a "Run Script" phase to your project and copy in the below script.

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

See below as to how to put this in.

Now when you click on the Issue Navigator you can see all your TODOs detailed.

 

 

And when you look into your code, you can see the lines highlighted as well.

 

Viola!  It highlights your TODOs and FIXMEs.

And Viola!  Your TODOs and FIXMEs are highlighted and organized.

This might bother some who see warnings as a red flag, but for me, being able to organize and view these sorts of things in XCode makes is easy for me to address what needs to be worked on, particularly when a coding partner needs me to address an issue.

The instruction for this comes from Deallocatedobjects.com so much kudos for pointing me in the right direction

https://deallocatedobjects.com/posts/show-todos-and-fixmes-as-warnings-in-xcode-4