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
60
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
75
riteshhh
3
440
riteshhh
1
83
riteshhh
3
140
Other Decks in Programming
See All in Programming
ippey
0
170
viteinfinite
0
200
itosho525
0
140
yamotuki
0
130
standfm
0
230
mizdra
7
4.8k
nauleyco
0
210
komagata
1
1.8k
shin1x1
0
590
makicamel
1
180
ken3ypa
0
160
hr01
1
1.2k
Featured
See All Featured
lynnandtonic
270
16k
shpigford
368
42k
vanstee
116
4.8k
danielanewman
1
470
philnash
8
490
dougneiner
119
7.8k
bkeepers
408
57k
jensimmons
207
10k
chrislema
231
16k
destraynor
146
19k
lara
590
61k
colly
66
3k
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