Save 37% off PRO during our Black Friday Sale! »

VIPER, IOS, AND FRAMEWORKS

876c710c06f8ae59611c0d3ab0e06cb0?s=47 Sonam
September 06, 2017

VIPER, IOS, AND FRAMEWORKS

An overview of the VIPER pattern, how to apply it to iOS frameworks and/or applications.

Example of a framework built using the VIPEBC (modified pattern) found here: https://github.com/ustwo/videoplayback-ios

876c710c06f8ae59611c0d3ab0e06cb0?s=128

Sonam

September 06, 2017
Tweet

Transcript

  1. VIPER, PATTERNS & FRAMEWORKS Sonam Dhingra Software Engineer sonam@ustwo.com |

    @sdhingra89 September 6, 2017
  2. Hi, we’re ustwo

  3. INNOVATIVE CLIENT WORK AWARD-WINNING OWN PRODUCTS AND GAMES LAUNCHING NEW

    VENTURES
  4. GAME PLAN 1 2 3 4 Introduction Choosing a Pattern

    Viper Implementation
  5. WHY CARE Design pattern knowledge Cocoa API knowledge Structuring code

    to fit design Not recommending Viper for everything
  6. GOAL By the end of this talk you will have

    an understanding of the Viper design pattern & how to apply it to your application or framework.
  7. LET’S BEGIN

  8. MVC MVVM VIPER THE PATTERNS US IOS PEEPS TALK ABOUT...

  9. VIPER View Interactor Presenter Entity Router

  10. VIPER View Interactor Presenter Entity Router Interface layer, sets up

    layout of view, updates images and labels ...etc Business logic, manipulation of data, transformation of models, Interacts with API Services, Data Managers and passes results to presenter Formats data for the view, receives input from view, Passes it to the interactor. A simple data representing what is needed for the VIPER Module to function An object responsible for module navigation And application navigation
  11. VIPER STANDARD VIEW ROUTER INTERACTOR Input Output Input Output PRESENTER

    ENTITY VIEWCONTROLLER
  12. View Interactor Presenter Entity Router VIPER + FRAMEWORK CONTRACT BUILDER

  13. VIPER + FRAMEWORK VIEW CONTRACT INTERACTOR Input Output Input Output

    PRESENTER BUILDER VIEWCONTROLLER ENTITY View Passes an entity to the builder, and the builder creates the interactor, presenter. Ultimately passes the view back to the view controller
  14. ABSTRACTION COOL WHAT? BUT NOW

  15. USER STORY CONTROL A VIDEO

  16. Actions Action Action SO MANY INTERACTIONS !!!!!!!!

  17. SAMPLE FRAMEWORK: VIDEO PLAYBACK KIT https://github.com/ustwo/videoplayback-ios

  18. VIPER & AVKIT, AVFOUNDATION VIEW INTERACTOR AVPLAYER PLAYER didTapPlay didTapPlay

    onPlaySuccess(playerLayer) PRESENTER didTapPlay PLAYER MANAGER - KVO - STATE ENTITY
  19. WHY VIPER Protocol oriented Testable Single Responsibility Principle Reusable

  20. Sonam Dhingra Software Engineer sonam@ustwo.com | @sdhingra89 THANKS