Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building modular Mac and iOS apps using Bundles

Building modular Mac and iOS apps using Bundles

Using WHPluginService to reduce NSViewController/UIViewController complexity and tight coupling of your applications.

Presented at Sydney Cocoaheads in March 2014.

James Dumay

March 21, 2014
Tweet

More Decks by James Dumay

Other Decks in Technology

Transcript

  1. Problems  with  building  Apps  on  iOS  and  Mac • NSViewControllers/UIViewControllers

     get  massive  +  complex  quickly   =  harder  to  understand  +  merge   • Tight  coupling  makes  apps  hard  to  refactor   • Easy  to  be  lazy.  AppDelegate  all  the  things.
  2. How  can  bundles  help? • Reduce  overall  complexity  of  your

     applicaKon  by  making  it  modular   • Keep  NSViewControllers/UIControllers  lean  +  mean     • Allow  others  to  extend  without  having  to  understand  the  whole  app
  3. Bundles • Bundles  encapsulate  code  and  resources   • Contains

     resources,  object  code  and  Info.plist   • Info.plist  defines  the  Principal  Class.     • Typically  found  in  <App  Bundle>/Contents/PlugIns   • Read  Apple’s  Bundle  Programming  Guide
  4. Structure Application Framework Bundles Plugin and controller protocols Classes that

    conform to protocols Controllers and other application code
  5. Resources • Apple’s  Bundle  Programming  Guide
 h"ps://developer.apple.com/library/mac/documenta7on/corefounda7on/ conceptual/c9undles/   •

    Plugin  loader  for  your  own  projects  (with  example)
 hTps:/ /bitbucket.org/whimsyinc/WHPluginService   • pod  ‘WHPluginService’  ‘~>  0.0.1’   • Ping  me  on  Twi"er  @i386