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

Practical iOS application modularity

Practical iOS application modularity

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

Bryan Irace

August 28, 2015
Tweet

More Decks by Bryan Irace

Other Decks in Technology

Transcript

  1. Mobile Developer Conference
    N Y C 8 26 15
    Practical iOS application modularity
    Bryan Irace

    View Slide

  2. M D C N Y C

    View Slide

  3. M D C N Y C

    View Slide

  4. M D C N Y C

    View Slide

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

    View Slide

  6. M D C N Y C
    Limit which parts of the
    codebase know about which
    other parts.

    View Slide

  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

    View Slide

  8. M D C N Y C
    One big codebase
    Small
    Isolated
    Knowable Components
    Many
    Easily
    or

    View Slide

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

    View Slide

  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.

    View Slide

  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/*"
    }

    View Slide

  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'

    View Slide

  13. M D C N Y C
    Development pods

    View Slide

  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

    View Slide

  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'

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

  20. M D C N Y C
    : bryan : irace
    Thank you!
    [email protected]

    View Slide