Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
How to be a POP-Star
Ritesh Gupta
July 05, 2017
Programming
1
63
How to be a POP-Star
POP - Protocol Oriented Programming
Ritesh Gupta
July 05, 2017
Tweet
Share
More Decks by Ritesh Gupta
See All by Ritesh Gupta
riteshhh
0
84
riteshhh
3
450
riteshhh
1
84
riteshhh
3
140
Other Decks in Programming
See All in Programming
tarappo
4
380
andrewgodwin
1
150
andpad
0
340
sisshiki1969
1
220
nerocrux
1
670
hamakou108
4
490
n1215
1
420
manfredsteyer
PRO
0
250
tom_uchida
0
130
tooppoo
1
440
hr01
1
4.1k
bosshawk
1
240
Featured
See All Featured
erikaheidi
14
4.5k
ddemaree
273
31k
smashingmag
232
18k
malarkey
193
8.7k
jponch
103
5.1k
ammeep
656
54k
mojombo
359
62k
samanthasiow
57
6.4k
jensimmons
208
10k
jnunemaker
PRO
40
4.7k
chriscoyier
683
180k
lara
590
61k
Transcript
how to be a POP-Star (Swift Chennai Meetup) ~ Ritesh
Gupta
/@_riteshhh /riteshhgupta /issues/295 /swift-snippets
None
None
`Protocol-Oriented Programming in Swift` https://developer.apple.com/videos/play/wwdc2015/408/ WWDC - 2015
`Protocol and Value Oriented Programming in UIKit Apps` https://developer.apple.com/videos/play/wwdc2016/419/ WWDC
- 2016
Swift is just not a syntax migration from Objective-C…
Swift is not objective-c styled language…
C ~> C++ Objective-C ~> Swift { imperative } {
object oriented } { object oriented } { protocol oriented }
Entity (class, struct - UI or Model) vs Behaviour (protocol)
Entity is collection of behaviours…
UIButton UIBarButtonItem
UIBarButtonItem UIBarItem NSObject UIButton UIControl UIView
UIBarButtonItem UIBarItem NSObject UIButton UIControl UIView
None
None
UIKit + Protocols
UIView Framable
UIImageView ImageRenderable, Framable
UIButton Tappable, ImageRenderable, Framable
compose everything with Protocols..
UITableViewCell UICollectionViewCell Reusable, Framable
UIScrollView Scrollable, Framable
UITableView UICollectionView Listable, Scrollable, Framable
thinking in protocol..
protocol ->
protocol -> protocol extension ->
protocol -> protocol extension -> protocol constrained extension ->
playground demos..
protocol is not a silver bullet.. http://chris.eidhof.nl/post/protocol-oriented-programming/
..computed variables, extensions, values types, immutability, functional programming, generics, enums,
associative types/ values..
None