Car π
Built with enviroment
- Xcode 9.0 beta 6
- Swift 4.0
Setup
- If you does not have Cocoapod:
gem install cocoapod
- Install pods:
pod install
- Open
open Carbrito.xcworkspace
- To use fastlane: https://github.com/ronanrodrigo/carbrito/tree/master/Fastlane
Structure
βββ <Module Name>
βΒ Β βββ Core ββββββββββββ Itens without third party dependencies;
βΒ Β βΒ Β βββ Entities ββββ Entities from Clean Architecture. Is where all domain logic lives;
βΒ Β βΒ Β βββ Gateways ββββ Gateways protocols. Used to get data from anywhere;
βΒ Β βΒ Β βββ Presenters ββ Presenter protocols. Used to present data from anywhere;
βΒ Β βΒ Β βββ Routers βββββ Routers protocols. Used to navigate to anywhere;
βΒ Β βΒ Β βββ Usecases ββββ Usecase from Clean Architecture. Is where all app logic lives;
βΒ Β βββ Factories βββββββ Agnostic to Architecture. Used to symplify D.I. and object constructions;
βΒ Β βββ Controllers βββββ Just controller. Does not know about UI stuffs like events and elements;
βΒ Β βββ Gateways ββββββββ Concrete implementation of gateways. Ex. knows about network or database;
βΒ Β βββ Routers βββββββββ Concrete implementation of routers. Ex. knows about navigation controller;
βΒ Β βββ Views βββββββββββ UI elements and events are placed here;
βββ Common ββββββββββββββ Shared stuffs accros modules;
βββ Essentials ββββββββββ Essential stuffs for the UIAppliction.
Main flow
ββ View ββββββββββ Controller ββββββββββ Usecase ββββββββββ Gateway?/Presenter? β
| View |
| Where user interaction are fired. Ex. Button tapped; |
| |
| Controller |
| Call usecase to execute user interaction; |
| |
| Usecase |
| Business logic; |
| |
| Gateway |
| Optional, used to get data from anywhere. Ex. Make a HTTP request. |
| Generaly injected in usecase; |
| |
| Presenter |
| Optional, used to present data to anywhere. Ex. Update view; |
| Generaly injected in usecase; |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π Goat in Brazil is called by Cabrito.