Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

2つの同期 4つの状態 #pixiv_ios_arch

2,007 views

Published on

2019/01/15開催の「iOSアプリ設計ナイト」の登壇資料です。

https://pixiv.connpass.com/event/112561/

Published in: Technology
  • Be the first to comment

2つの同期 4つの状態 #pixiv_ios_arch

  1. 1. 2019/01/15 iOS #pixiv_ios_arch
  2. 2. • / @ktanaka117 • • BOOTH iOS • R&D Swift TDD • PEAKS iOS
  3. 3. Voice Transformer VT-4
  4. 4. Voice Transformer VT-4 👧

  5. 5. • GUI 2 4 • 

  6. 6. • • • 2 • 4 • GUI • •
  7. 7. • • GUI Architectures
 https://martinfowler.com/eaaDev/uiArchs.html • Flow Synchronization
 https://www.martinfowler.com/eaaDev/FlowSynchronization.html • Observer Synchronization
 https://www.martinfowler.com/eaaDev/MediatedSynchronization.html
  8. 8. 2 • • GUI
  9. 9. • • • • etc…
  10. 10. GUI • MVC • MVP • MVVM • Flux • Redux • etc…
  11. 11. GUI • GUI • View 
 Model • • = Presentation Domain Separation(PDS)
  12. 12. PDS GUI
  13. 13. 2 • (Observer Synchronization) • (Flow Synchronization)
  14. 14. • • • • • ex.) NotificationCenter 
 center.post(name: .someNotification, object: nil)
  15. 15. • • • • • ex.) 
 label.text = “hoge”
 SessionManager.shared.authToken = “1234567890”
  16. 16. 4 • 4 • Screen State • Presentation State • Session State • Record State
  17. 17. Screen State • View • GUI • ex.) label.text, imageView.image
  18. 18. Presentation State • Presenter • Screen State 
 Screen State Session State • ex.) presenter.labelText, presenter.iconImage, presenter.favState
 
 Twitter 
 on/off (Screen State) 
 (Session/Record State)
  19. 19. Session State • Model • Record State • Record State • • ex.) API/DB 
 
 …
  20. 20. Record State • DataStore • • ex.) Realm 
 API
  21. 21. Clean Architecture State Presenter ViewModel UseCase Interactor APIClient DBClient Presentation Layer Domain Layer Data Layer Clean Architecture GUI 
 Clean Architecture State View ViewController
  22. 22. Presenter ViewModel APIClient DBClient Presentation Layer Domain Layer Data Layer GUI ViewController View 
 Screen State View ViewController Clean Architecture State UseCase Interactor
  23. 23. Presenter ViewModel APIClient DBClient Presentation Layer Domain Layer Data Layer View UseCase Presenter/ViewModel 
 Presentation State View ViewController Clean Architecture State UseCase Interactor
  24. 24. Presenter ViewModel APIClient DBClient Presentation Layer Domain Layer Data Layer UseCase Interactor Data Layer 
 Data Layer Session State View ViewController Clean Architecture State UseCase Interactor
  25. 25. Presenter ViewModel APIClient DBClient Presentation Layer Domain Layer Data Layer DB Record State 
 API DB DB View ViewController Clean Architecture State UseCase Interactor
  26. 26. PDS GUI
  27. 27. PDS 
 
 Screen State Record State
  28. 28. State = Presenter ViewModel APIClient DBClientView ViewController UseCase Interactor Screen State Record State PDS 

  29. 29. 
 Fat APIClient DBClientView ViewController State =
  30. 30. Presenter ViewModel UseCase Interactor APIClient DBClient MVC, MVP, MVVM GUI 
 Screen State State View ViewController UseCase Interactor APIClient DBClient Presenter ViewModel 
 State
  31. 31. Presenter ViewModel UseCase Interactor APIClient DBClient View ViewController UseCase Interactor APIClient DBClient Presenter ViewModel 
 State etc… 
 💪
  32. 32. Screen/Presentation State Session/Record State ModelView(Controller) (Cocoa) MVC
  33. 33. Twitter 
 Presentation State Screen State MVP(Supervising Controller) View Model Presenter
  34. 34. Session/Record 
 MVP(Supervising Controller) View Model Presenter
  35. 35. 
 MVP(Passive View) View ModelPresenter
  36. 36. GUI • 
 • • 

  37. 37. • • 
 • 
 •

×