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
7 different code blocks for 7 purpose:
- UIViewController lifecycle
- view lifecycle
- subviews setup
- subviews updating
- user interaction
- delegate and datasource
- notification (listener and handler)
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.