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

Onion-like app architecture

Onion-like app architecture

Learn how to architect an entire app – from UI, through user / data flows and transactions down to data storage and delivery – in independent, interchangeable layers. With layers that can be freely combined as needed, with no or minimal disruption to the rest of app. Just like an onion. You will learn that MVC is excellent, if employed properly. You will learn how to use Coordinators without delegates and with truly minimal UIKit extensions. Learn about an approach suitable for iOS teams of one and teams of 1000 developers. For 5 screen apps and for 200+ UIViewController behemots.

https://github.com/radianttap/Coordinator

https://github.com/radianttap/Spotifier

Video: https://www.youtube.com/watch?v=kD8dRvEQ5II

More Decks by Aleksandar Vacić (Radiant Tap)

Other Decks in Technology

Transcript

  1. Aleksandar Vacić @radiantav O N I O N - L

    I K E A P P A R C H I T E C T U R E App Builders 2019
  2. · 100+ screens (few dozen are multi-screen flows) · multiple

    external services · 10+ languages (with runtime updates) · 20+ markets in Europe, Africa and S. America · iOS, tvOS, watchOS, widgets · Notifications, deep links, home screen actions SPORTS BETTING · Unpredictable future expansion
  3. Connect to web services Import into local storage Cache temporary

    data Directly target any screen, at any depth Transform any 3rd party data model into my own Multi-screen user flow Multi-service data flow Multi-OS reusability Reading data is always super performant c h a l l e n g e s
  4. Build complex system that works by first building a simple

    system that works. Break complex, multi-faceted flows into self-sufficient steps. Then compose them back. p r i n c i p l e s
  5. Data Source Data Delivery Data Storage web service, bundled file,

    cached download URLSession, FileManager, Authentication, Encryption Core Data, mobile db, in-memory, file / custom store
  6. O N I O N G A R L I

    C It resembles , isn’t it?
  7. Coordinator
 Advanced implementation of said pattern in Swift, including care-free

    messaging through UIResponder chain. Avenue
 URLSession wrapper, handles boilerplate, enables seamless usage with Operation(Queue). Ambar
 Custom Core Data stack with automatic merge of background imports into main MOC. / radianttap
  8. What were my problems, or… KILS Architecture Benefits Builds on

    system frameworks ɠ Rapid iterations ɡ Painless refactoring ɢ Low maintenance cost ɣ