Adding a // MARK: comment to your codeXcode Mark Lines are added through commented code. Xcode parses those comments into chapter lines within the method navigator.
Add a heading: Insert a comment with the prefix MARK:. For example: // MARK: [your section heading]. Add a separator line: To add a separator above an annotation, add a hyphen (-) before the comment portion of the annotation.
Is there a way to comment various lines at the same time in Xcode IDE? Selecting which lines to comment, then clicking somewhere et voilá.. the /* ... */ characters wrapping the code. Thank you.
There are two ways to add comments in Swift: // - Single Line comments. /*... */ - Multiline Comments.
I got it.
Writing comment like:
// TODO: Do something
Will do the trick.
I got something like:
Also there is a lot of options like:
// FIXME: Midhun
// ???: Midhun
// !!!: Midhun
// MARK: Midhun
// TODO: the thing todo
Is how you show todo tasks.
Using the
//TODO: some thing here
works if all you want to do is to look at the list of todos in the drop down
If you want to be intrusive you can use #warning
marks instead:
#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 a little more "in your face" about reminding you of things you need to do.
With the script below your can see all required tags like warnings.
Add below script to "Run Script" The script:
KEYWORDS="TODO:|FIXME:|DevTeam:|XXX:"
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/"
Original answer was taken from Here
Another alternative is XToDo plugin for Xcode.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With