Practical iOS application modularity

Practical iOS application modularity

Slides from Yahoo’s NYC Mobile Developer Conference (http://ymdcnyc.tumblr.com) on 8/26/2015.

3770c1b6a421c8d4de4177356911a829?s=128

Bryan Irace

August 28, 2015
Tweet

Transcript

  1. Mobile Developer Conference N Y C 8 26 15 Practical

    iOS application modularity Bryan Irace
  2. M D C N Y C

  3. M D C N Y C

  4. M D C N Y C

  5. M D C N Y C + (UIApplication *)sharedApplication NS_EXTENSION_UNAVAILABLE_IOS

  6. M D C N Y C Limit which parts of

    the codebase know about which other parts.
  7. M D C N Y C When concerns are well-separated,

    individual sections can be reused, as well as developed and updated independently. -Wikipedia
  8. M D C N Y C One big codebase Small

    Isolated Knowable Components Many Easily or
  9. M D C N Y C Modularity = • Easier

    to build separate applications • New products • iOS or OS X • iOS extensions • watchOS applications
  10. M D C N Y C Modularity = • Additional

    overhead • More repositories, READMEs to update, version numbers to increment • Tooling complexity • CocoaPods, Carthage, Gradle, etc.
  11. M D C N Y C { "name": "ComposeUI", "summary":

    “Tumblr’s composition UI for iOS.", "platforms": { "ios": "8.0" }, "requires_arc": true, "frameworks": [ "Foundation", "UIKit", ], "source_files": "Classes/**/*.{h,m}", "resources": "Resources/*", "dependencies": { "SharedUI": [], } } { "name": "SharedUI", "summary": "UI components shared across Tumblr’s apps and extension", "platforms": { "ios": "8.0" }, "requires_arc": true, "frameworks": [ "Foundation", "UIKit" ], "source_files": "Classes/**/*.{h,m}", "resources": "Resources/*" }
  12. M D C N Y C pod 'Reachability', '3.2' pod

    'MTMigration', '0.0.3' pod 'HockeySDK', '3.7.1' pod '1PasswordExtension', '1.1.0'
  13. M D C N Y C Development pods

  14. M D C N Y C Development pods • No

    need to version • Can be anywhere on disk, e.g. in the app’s repository • Easy to make one pull request against multiple modules
  15. M D C N Y C pod 'ComposeUI', :path =>

    ‘Components/ComposeUI' pod 'ExploreUI', :path => 'Components/ExploreUI' pod 'SharedUI', :path => 'Components/SharedUI' pod 'CoreTumblr', :path => 'Components/CoreTumblr' pod 'CoreExplore', :path => 'Components/CoreExplore' pod 'Logger', :path => 'Components/Logger'
  16. M D C N Y C Compose UI Core Tumblr

    Tumblr SDK Explore UI Core Explore Network Abstractions Shared UI Logger Video Player Audio Share extension Today widget App
  17. M D C N Y C Compose UI Core Tumblr

    Tumblr SDK Explore UI Core Explore Network Abstractions Shared UI Logger Video Player Audio
  18. M D C N Y C Flexibility • Can always

    turn dev. pods into “real pods” • Xcode project only knows about .framework files • Could always move away from CocoaPods
  19. M D C N Y C Summary • Modular codebases

    facilitate rapid product development • “Development pods” provide many benefits of modularity without too much overhead
  20. M D C N Y C : bryan : irace

    Thank you! bryan@tumblr.com