Archive for February 7, 2014

Friday, February 7, 2014

Avoiding Massive Controllers

Brad Grzesiak (via Mark Bernstein):

Well, to be sure we’re on the same page, allow me propose rules that must be followed in order to adhere to this heuristic:

  • The IBAction macro must not be used in a View Controller
  • The @interface block in a View Controller’s header file must be blank.
  • A View Controller may not implement any extra *Delegate or *DataSource protocols except for observing Model changes.
  • A View Controller may only do work in viewDidLoad (or awakeFromNib), viewDidAppear, viewDidDisappear, and in response to an observed change in the model layer.