In iOS development field, View Controller(UIViewController) is an object that does a lot things.

For sake of clarity, I visually divide code in view controller into different parts by using #pragma mark(s).

7 different code blocks for 7 purpose:

  1. UIViewController lifecycle
  2. view lifecycle
  3. subviews setup
  4. subviews updating
  5. user interaction
  6. delegate and datasource
  7. notification (listener and handler)
  8. helper

With the help of #pragma mark(s) I can easily navigate my view controller and classify different part of codes.

I am willing to hear from you about how you organize your view controller code.