Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the equivalent of "#pragma mark -" in swift? [duplicate]

Tags:

xcode

swift

I want to organize my code by sections. usually I used #pragma mark - Section Name but when I try to do so in a .swift file it doesn't work.

So my question is if I can somehow enable it and if not what is the way to organize my code in sections in a .swift file?

like image 433
Tomer Even Avatar asked Jun 08 '14 09:06

Tomer Even


1 Answers

Use something like that:

// MARK: - UITableViewDataSource

Or use extensions: I love the way how UITableViewDataSource delegate is implemented in this answer

like image 140
B.S. Avatar answered Oct 28 '22 13:10

B.S.