RxRIBs: Multiplatform architecture with Rx

6a11050c8147e4f5fbf2637907c27964?s=47 VCNC
November 06, 2018

RxRIBs: Multiplatform architecture with Rx

RxRIBs
Multiplatform architecture with rx

6a11050c8147e4f5fbf2637907c27964?s=128

VCNC

November 06, 2018
Tweet

Transcript

  1. 3.

    Table of Contents 1 Why a new architecture? 2 RIBs

    at Uber 3 What we got from RIBs 4 RIBs at VCNC
  2. 7.

    Why a new architecture? Project started 2018.06 Driver α 2018.07

    2018.08 2018.09 2018.10 Rider α Beta Public release
  3. 11.

    Factors to consider No MVC (no MVVM or MVP, too)

    - MVC stands for Massive View Controller - Keeping components simple Single Activity Application - We’re making a map-based application No time to create a framework from scratch - Conductor, Scoop, ReSwift, ReactorKit, Reflex, …
  4. 12.

    Factors to consider No MVC (no MVVM or MVP, too)

    - MVC stands for Massive View Controller - Keeping components simple Single Activity Application - We’re making a map-based application No time to create a framework from scratch - Conductor, Scoop, ReSwift, ReactorKit, Reflex, …
  5. 13.

    Factors to consider No MVC (no MVVM or MVP, too)

    - MVC stands for Massive View Controller - Keeping components simple Single Activity Application - We’re making a map-based application No time to create a framework from scratch - Conductor, Scoop, ReSwift, ReactorKit, Reflex, …
  6. 24.

    Convoluted state machines Change Email Home Screen Menu Search for

    Location Change Vehicle Options Refine Location Request Vehicle Vehicle Matched Receipt On trip Verify Phone Number
  7. 25.

    State tree Root Main LoggedOut Menu Request Ride LocationEditor Confirm

    Refinement Coupon DroppedOff Card Matched Pending Viewless Viewful Email, PW, ...
  8. 26.

    RIB tree Root Main LoggedOut Menu Request LocationEditor Confirm Refinement

    Coupon Card Viewless Viewful Ride DroppedOff Matched Pending Email, PW, ...
  9. 27.

    RIB tree Root Main LoggedOut Menu Request LocationEditor Confirm Refinement

    Coupon Card Viewless Viewful Ride DroppedOff Matched Pending Email, PW, ...
  10. 28.

    RIB tree Root Main LoggedOut Menu Request LocationEditor Confirm Refinement

    Coupon Card Viewless Viewful Ride DroppedOff Matched Pending Email, PW, ...
  11. 29.

    RIB tree Root Main LoggedOut Menu Request LocationEditor Confirm Refinement

    Coupon Card Viewless Viewful Ride DroppedOff Matched Pending Email, PW, ...
  12. 30.

    RIB tree Root Main LoggedOut Menu Request LocationEditor Confirm Refinement

    Coupon Card Viewless Viewful Ride DroppedOff Matched Pending Email, PW, ...
  13. 31.

    RIB tree Root Main LoggedOut Menu Request LocationEditor Confirm Refinement

    Coupon Card Viewless Viewful Ride DroppedOff Matched Pending Email, PW, ...
  14. 32.

    RIB tree Root Main LoggedOut Menu Request LocationEditor Confirm Refinement

    Coupon Card Viewless Viewful Ride DroppedOff Matched Pending Email, PW, ...
  15. 33.

    RIB tree Root Main LoggedOut Menu Request LocationEditor Confirm Refinement

    Coupon Card Viewless Viewful Ride DroppedOff Matched Pending Email, PW, ...
  16. 37.

    Scopes class AuthenticateNetworkRequest: NetworkRequest { private var authToken: String? public

    func makeRequest() { if let authToken = authToken { addAuthToken(authToken) } super.makeRequest() }
  17. 38.

    Scopes // `authToken` is not null in MainScope class AuthenticateNetworkRequest:

    NetworkRequest { private var authToken: String public func makeRequest() { addAuthToken(authToken) super.makeRequest() } }
  18. 40.

    Scopes public func refresh() { if let ride = self.ride

    { getRideStatus(ride.id) } else { getUserStatus(self.user!.id) } }
  19. 41.

    Scopes // `ride` is not null in RideScope public func

    refresh() { getRideStatus(self.ride.id) }
  20. 44.

    Flow of data (Uber RIBs) Interactor (business logic) Presenter (translation

    logic) Router (attach/detach RIBs) View (layout & interaction)
  21. 45.

    Flow of data (VCNC RIBs) Interactor (business logic) Presenter (translation

    logic) Router (attach/detach RIBs) View (layout & interaction) Events
  22. 46.

    Animations No consideration in Uber RIBs Need to think about

    RIBs transitions UITransitioningDelegate in UIViewController HeroTransitions func transition(from: UIViewController, to: UIViewController) in view: UIView, completion: ((Bool) -> Void)? = nil)
  23. 48.

    Wrap-up 1 Multi-platform architecture 2 Router, Inteactor, Builder, Presenter, and

    View 3 Business logic determines the state tree 4 Scopes 5 Unidirectional data flow, Animations, Lifecycle
  24. 49.