Are you use to using the #pragma mark pre-processor directive in c/c++/objective-c and have found yourself stuck in Swift? If you don’t know why you should be using #pragma mark then I recommend this NSHipster article on #pragma mark.

In Swift use the // MARK: feature instead:

// MARK: This is the comment you want to end up in the jump bar.

Having said that, it is recommended that in Swift you should break up your code into logical units by the liberal use of extensions where possible.

So for example you could implement all the delegate methods that a class conforms to in a class extension, see this stack overflow Q&A and ignore the comments about // MARK: not yet being implemented.

As well as

// MARK:

there is:

// TODO:, and // FIXME:

And a last update via @TheCocoaNaut that // MARK: etc. all work in Objective-C as well.

Tags: ,