What happened to #pragma mark in Swift?

If your not familiar with #pragma mark you’ve been missing out on a cool way to organizing your file. It simply allowed you to add separators and comments in your jump bar. With the introduction of swift #pragma mark simply became // Mark: .


The above syntax will allow you to mark off a section of your code and will look like this in the jump bar.


// Mark:- Produces a thick line across the jump bar

// Mark:- comment  Creates a line above the comments

This will appear in the jump bar like so

I regularly use this to organize my code in the following way.

The jump bar should now look like this.

This was super helpful when MVC was the norm, however, I still feel it has its place in any design pattern including MVVM.

It keeps your file nicely organized and lets other developers know which part of the file to look, to locate a specific method.