Slide 1

Slide 1 text

Vinita Miranda Clean Swift Architecture

Slide 2

Slide 2 text

Introduction ! iOS Developer at Dream11 ! Passionate about teaching ! I am a foodie and I love exploring new places

Slide 3

Slide 3 text

1. SELECT A MATCH From upcoming live matches 2. CREATE YOUR TEAM Of real players from that match 2. COMPETE FOR POINTS Based on players’ real-life performance Dream11

Slide 4

Slide 4 text

Why care about architecture? Distribution Testability Ease of Use

Slide 5

Slide 5 text

Sample App

Slide 6

Slide 6 text

MVC Expectation

Slide 7

Slide 7 text

Reality

Slide 8

Slide 8 text

Alternative approaches Distribution Testability Easy of Use

Slide 9

Slide 9 text

Clean Swift Template • https://clean-swift.com/swift-3-compatible/

Slide 10

Slide 10 text

Clean Swift Architecture

Slide 11

Slide 11 text

View Controller - Interactor View Controller Interactor Business Logic Protocol & Request

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

Models ! It will be of type struct and mostly it will contain Request, Response, and ViewModel structs. ! Request – Parameters that need to be sent to the API request. ! Response – Gets the response from the API and stores the appropriate data. ! ViewModel – The data required to be displayed on the UI is stored here. For example, your API returns objects with 10 parameters, but you only need to show 4 of them.

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

Interactor - Presenter Interactor Presenter Presenter Logic Protocol & Response

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

Interactor - Worker Interactor News Worker Account Worker Request

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

Presenter - View Controller Presenter View Controller Display Logic Protocol & View Model

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

View Controller - Router View Controller Router Routing Logic Protocol

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

Unit Tests

Slide 24

Slide 24 text

References ! Template download: https://clean-swift.com/swift-3-compatible/ ! http://slides.com/borlov/arch ! https://clean-swift.com/ ! https://hackernoon.com/introducing-clean-swift-architecture-vip-770a639ad7bf ! https://github.com/vinitam/SwiftIndia

Slide 25

Slide 25 text

THANK YOU [email protected] https://www.linkedin.com/in/vinita-miranda-3874a824