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

VIPER, IOS, AND FRAMEWORKS

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

Sonam

September 06, 2017
Tweet

More Decks by Sonam

Other Decks in Programming

Transcript

  1. WHY CARE Design pattern knowledge Cocoa API knowledge Structuring code

    to fit design Not recommending Viper for everything
  2. 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.
  3. 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
  4. 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
  5. VIPER & AVKIT, AVFOUNDATION VIEW INTERACTOR AVPLAYER PLAYER didTapPlay didTapPlay

    onPlaySuccess(playerLayer) PRESENTER didTapPlay PLAYER MANAGER - KVO - STATE ENTITY