Slide 1

Slide 1 text

VIPER, PATTERNS & FRAMEWORKS Sonam Dhingra Software Engineer [email protected] | @sdhingra89 September 6, 2017

Slide 2

Slide 2 text

Hi, we’re ustwo

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

GAME PLAN 1 2 3 4 Introduction Choosing a Pattern Viper Implementation

Slide 5

Slide 5 text

WHY CARE Design pattern knowledge Cocoa API knowledge Structuring code to fit design Not recommending Viper for everything

Slide 6

Slide 6 text

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.

Slide 7

Slide 7 text

LET’S BEGIN

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

VIPER View Interactor Presenter Entity Router

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

VIPER STANDARD VIEW ROUTER INTERACTOR Input Output Input Output PRESENTER ENTITY VIEWCONTROLLER

Slide 12

Slide 12 text

View Interactor Presenter Entity Router VIPER + FRAMEWORK CONTRACT BUILDER

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

ABSTRACTION COOL WHAT? BUT NOW

Slide 15

Slide 15 text

USER STORY CONTROL A VIDEO

Slide 16

Slide 16 text

Actions Action Action SO MANY INTERACTIONS !!!!!!!!

Slide 17

Slide 17 text

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

Slide 18

Slide 18 text

VIPER & AVKIT, AVFOUNDATION VIEW INTERACTOR AVPLAYER PLAYER didTapPlay didTapPlay onPlaySuccess(playerLayer) PRESENTER didTapPlay PLAYER MANAGER - KVO - STATE ENTITY

Slide 19

Slide 19 text

WHY VIPER Protocol oriented Testable Single Responsibility Principle Reusable

Slide 20

Slide 20 text

Sonam Dhingra Software Engineer [email protected] | @sdhingra89 THANKS