-2

Is there any way in Xcode to put some notes.

For example I want to work on some feature later, but want to put there a note. So that I can find all the notes I have written and go directly to the portion of code I had to work.

I have used pragma marks but it is related to a single class, I cannot know all the notes though.

Chanchal Raj
  • 4,176
  • 4
  • 39
  • 46

3 Answers3

6

You can use below command:-

//TODO: some thing here

OR

#warning this will create a compiler warning.

And when you build the app you will get a compiler warning (a yellow triangle, not a compiler error) which is about reminding you of things you need to do.

poojathorat
  • 1,200
  • 2
  • 9
  • 19
  • Thanks, can I get to know as a whole at some place in Xcode the list of all todos instead of going into each class? – Chanchal Raj Jul 31 '15 at 13:29
2

If you're working with Objective-C (I'm not sure if it supports Swift yet), you can try AppCode. It has built-in support for displaying all //TODO's inside all of your classes.

Or you can try this XCode plugin.

halileohalilei
  • 2,220
  • 2
  • 25
  • 52
-2

If you want something like this

enter image description here

You can add custom bush script before or after building, running, testing, archiving and so on!

Steps:

1. Navigate to your project's build phases in Xcode, click on the + sign towards the top left of the window, and then click on "New Run Script Build Phase" in the drop down menu: enter image description here

2. You should then see a new section added where you can inject your bash script. In the body of your run script build phase, copy and paste this lovely bit of code:

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

3. From here on out, you should now see warnings when you mark your code with TODO: or FIXME: comment blocks! Here's a screenshot:

enter image description here

For more details see this article by krakendev.io

Tikhonov Aleksandr
  • 13,945
  • 6
  • 39
  • 53