Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 7 - Swift TODO comments

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?

like image 661
seanu13 Avatar asked Oct 05 '15 14:10

seanu13


2 Answers

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

like image 154
casillas Avatar answered Sep 26 '22 03:09

casillas


Just pasting your comments code in Xcode 7 with Swift 2.0 seems to work. It looks like this:enter image description here

like image 39
Rony Rozen Avatar answered Sep 25 '22 03:09

Rony Rozen