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

Framework based architecture using Cocoapods

Framework based architecture using Cocoapods

A introduction to our CHECK24 iOS app architecture approach for maximum speed and individuality for all products and company units.

Stefan Mayer-Popp

May 18, 2016
Tweet

Other Decks in Programming

Transcript

  1. Situation 900 Source files in Swift
 200 Source files in

    Objective-C 25~ full-time iOS developers

  2. Files 225 450 675 900 Compile time 01:30.017 03:00.035 04:30.053

    06:00.070 12.2.2015 22.9.2015 23.11.2015 22.12.2015 22.1.2016 8.2.2016 Compile time / file count
  3. Files 500 1000 1500 2000 Compile time 23:45 47:30 1:11:15

    1:35 12.2.2016 12.4.2016 12.6.2016 12.8.2016 Forecast
  4. Files 350 700 1050 1400 Compile time in seconds 07.500

    15 22.500 30 100 files 300 files 501 files 1000 1300 Class test
  5. Problems Long compiler argument list Path names No dependency check

    Excessive use of globals Waiting up to 300h per month
  6. External Another product Product B The product Core Plugin UI

    Components Product A APP Initial architecture
  7. What is our goal? ⏱ Fast compile times Strict plugin

    architecture Technical separation Better testability ♻ Reusable components
  8. Product B Product D Product A Core Plugin UI Components

    Product C New architecture The APP
  9. Frameworks A framework is a hierarchical directory that encapsulates shared

    resources, such as a dynamic shared library, nib files, image files, localized strings, header files, and reference documentation in a single package.
  10. Framework magic Frameworks group related, but
 separate, resources together A

    framework can include any relevant 
 header files and documentation It shares the application context Frameworks can include a wider variety
 of resource types than libraries
  11. Framework based App Core Plugin Framework Pod Product A Umbrella

    App Core Plugin Framework Pod Product B Umbrella App
  12. Framework based App Core Plugin Framework Pod Product A Umbrella

    App Core Plugin Framework Pod Product C Umbrella App Core Plugin Framework Pod Product B Umbrella App
  13. Framework based App Core Plugin Framework Pod Product A Umbrella

    App Core Plugin Framework Pod Product C Umbrella App Core Plugin Framework Pod Product B Umbrella App
  14. Framework based App Core Plugin Framework Pod Product A Umbrella

    App Core Plugin Framework Pod Product C Umbrella App Core Plugin Framework Pod Product B Umbrella App
  15. git

  16. git

  17. git

  18. Workflow The 
 App Product A v1.01 Product B >

    v1.2 Externals Podfile CORE = v2.4 Components = v1.3
  19. source 'https://git.your-company.de/CocoaPods/Specs.git' platform :ios, '8.0' use_frameworks! target "TheApp" do pod

    'core', '>3.11' pod 'uicomponents' pod 'productA', '>=0.34' pod 'productB', '1.0' pod 'greaterProductC' end Podfile
  20. Pro’s Small project footprints Binary delivery is possible Awesome compile

    times, again Strict namespaces Reuseabilty No single project anymore! Future save architecture
  21. Con’s Critical parts of the existing app will be rewritten

    Scopes need to be defined Use of C libraries breaks often No shared assets within IB Binary dependencies do not work in frameworks (e.g. HockeyApp)
  22. Daily cons Every checkout implies pod update Other products are

    less visible Complex versioning and release management Missing version updates leads to uncompilable Apps
  23. Unus pro omnibus, 
 omnes pro uno No product x

    specific code in core 
 components No centralized classes for everything Think big and small Communicate
  24. Happy pod-tifying Feel free to share your ideas! and may

    the odds be ever in your favor [email protected] slack.swiftde.net Invite only