Xcode 7 - Swift TODO comments

seanu13 picture seanu13 · Oct 5, 2015 · Viewed 14.2k times · Source

Using Xcode 7 and Swift 2.0, I'm trying to use TODO comments like I would in Visual Studio with C#. I've found sites suggesting

// MARK: comment here
// TODO: comment here
// FIXME: comment here

but none of these seem to work. I'm checking the function hierarchy where it looks like the comments should appear afterwards, and it never updates.

This is what I'm expecting:

A TODO: comment showing up in Xcode's intellisense

How can I get these comments to show up in Xcode's intellisense?

Answer

casillas picture casillas · Dec 15, 2018

Adding code annotation to the jump bar

You can add useful information, such as to-dos, bug-fix reminders, and section headings to the jump bar symbol pop-up menu by annotating your code in the source editor.

Add a to-do item: Insert a comment with the prefix TODO:.

For example:

// TODO: [your to-do item].

Add a bug fix reminder: Insert a comment with the prefix FIXME:.

For example:

// FIXME: [your bug fix reminder].

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.

For example:

// MARK: - [your content]. To add a separator below an annotation, add a hyphen (-) after the comment portion of the annotation.

For example:

// MARK: [your content] -.

https://help.apple.com/xcode/mac/current/#/dev86a148f73