Unburdened ViewControllers by Jay Thrash

Unburdened ViewControllers by Jay Thrash

Jay discusses an alternative to MVC that can help in creating less cluttered view controllers from CocoaHeads August in Raleigh

F13b7ea691e49d2cb953e10317f21976?s=128

Triangle Cocoa

August 23, 2012
Tweet

Transcript

  1. 6.
  2. 12.

    Store Interface #import <Foundation/Foundation.h> @class CHItem; @interface CHItemStore : NSObject

    { NSMutableArray *items; } // Access the singleton Store + (CHItemStore *)store; // Access Store contents - (NSArray *)allItems; - (void)addItem:(CHItem *)item; - (void)removeItem:(CHItem *)item; // Persist Store contents - (BOOL)save:(NSError *)err; @end
  3. 13.

    Store Responsibilities • Model Objects from Data Sources • Handles

    Loading & Saving of Model Objects • Encapsulates Caching and Lazy Fetching
  4. 14.

    Before & After Store Controller Fetches Models Controls Flow Persists

    Models Get, Update, Insert using Store Encapsulates Saving Requests Saving Caches Data Not concerned with data caching
  5. 19.

    Benefits • Reusable Views - Just add a Model •

    ViewController as Conductor • Interface with Store • Handle User’s Input
  6. 20.

    Name Author URL iOS Programming Joe Conway and Aaron Hillegass

    http://www.bignerdranch.com Ubuntu Font Family Canonical, Ltd. http://font.ubuntu.com/ Unburdened ViewControllers Jay Thrash :: jay.thrash@mac.com :: @jaythrash Resources & Attributions