Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
Definiendo límites
Francisco Díaz
December 14, 2017
Programming
1
25
Definiendo límites
Presentado en iOS Love en Diciembre, 2017
Francisco Díaz
December 14, 2017
Tweet
Share
More Decks by Francisco Díaz
See All by Francisco Díaz
fdiaz
4
190
fdiaz
0
40
fdiaz
2
54
fdiaz
1
230
fdiaz
1
42
fdiaz
1
52
fdiaz
0
32
fdiaz
0
41
Other Decks in Programming
See All in Programming
takapdayon
0
190
ntaro
0
170
kimyan
3
520
coa00
2
190
takapy
0
200
takutakahashi
3
310
mrtc0
2
1k
fixel_admin
0
120
manfredsteyer
PRO
0
170
borkdude
2
220
sansuke05
1
140
boriswilhelms
0
170
Featured
See All Featured
paulrobertlloyd
72
1.4k
ufuk
56
5.4k
sferik
610
55k
orderedlist
PRO
328
36k
brad_frost
157
6.5k
colly
66
3k
rasmusluckow
318
18k
dougneiner
118
7.9k
thoeni
3
610
dotmariusz
94
5.5k
brianwarren
82
4.7k
pedronauck
652
110k
Transcript
DEFINIENDO LIMITES
Francisco Díaz franciscodiaz.cl
None
3 desarrolladores iOS 28 horas 1 projecto
EVA BC programs provide vital support to anti- violence programs
and communities across BC. — Ending Violence Association ONG
None
Features: → Botón de pánico → Today widget → Knock
Botón de pánico: Al presionar el botón → Reportar
Today widget: Al presionar el botón → Reportar
Knock Al golpear el teléfono → Reportar
División de trabajo
Por feature → 1 Dev: Pantalla con botón en iOS
app → 1 Dev: Today widget → 1 Dev: Knock
None
None
None
❌ Una persona por "feature" ✅ Una persona por "capa"
None
Dependencias
Dependency inversion
protocol ReportCreator { func createReport() throws -> Report }
class SuccessReportCreator: ReportCreator { func createReport() throws -> Report {
return Report(id: "1", date: Date()) } } class ErrorReportCreator: ReportCreator { func createReport() throws -> Report { throw ReportCreationError.fakeError } }
class BigPanicButtonViewController: UIViewController { private let reportCreator: ReportCreator init(reportCreator: ReportCreator)
{ self.reportCreator = reportCreator } func didTapBigPanicButton() { do { // Handle Report let report = try reportCreator.createReport() } catch { // Handle error } } }
class BigPanicButtonViewController: UIViewController { init(reportCreator: ReportCreator = SuccessReport()) { ...
} }
¿Si el usuario no tiene internet?
None
None
None
None
protocol APIRequester { func createReport() throws -> JSON } protocol
SMSHandler { func sendSMS() throws -> SMS } protocol ConnectivityListener { var isConnected: Bool { get } }
Nada existe aún, pero podemos probar si funciona
Demo
Recap → Movernos independientemente → Reducir conflictos → No hay
necesidad de esperar para integrar código.
¿Preguntas?