14

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?

Tomer Even
  • 4,820
  • 2
  • 30
  • 36
  • yes but I want to separate for example the uitableview delegate from the uttableview datasource and if i'll make a class for each section ill get more classes then i can handle – Tomer Even Jun 08 '14 at 09:37

1 Answers1

40

Use something like that:

// MARK: - UITableViewDataSource

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

Community
  • 1
  • 1
B.S.
  • 21,660
  • 14
  • 87
  • 109