Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
How to be a POP-Star
Search
Ritesh Gupta
July 05, 2017
Programming
1
270
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
Declarative Networking with Combine –– iOS Conf SG 2020
riteshhh
0
150
Combine! All the things
riteshhh
3
670
Deep dive into Protocols
riteshhh
1
310
Thinking in Swift!
riteshhh
3
330
Other Decks in Programming
See All in Programming
CSC307 Lecture 05
javiergs
PRO
0
210
feature環境をGitHub ActionsとCloudFormationでいい感じに管理する
nealle
2
310
ピグパーティにおけるMongoDB CommunityバージョンからAtlasへの移行事例
10969hotaka
0
130
しくじり先生 Image Matching Challenge 2024 編
goosehaaan
0
810
CSC307 Lecture 08
javiergs
PRO
0
330
大規模マルチテナントを解決するYugabyteDBという選択肢
nnaka2992
1
250
SRE チーム立ち上げ前に考えたこと・取り組んだこと / Considerations and Preparations Before Establishing an SRE Team
mackey0225
3
320
英語
s_shimotori
1
220
How to use Macrobenchmark
veronikapj
0
160
君たちはどうコードをレビューする (される) か / 大吉祥寺.pm
utgwkk
15
8.5k
Introduction of Happy Eyeballs Version 2 (RFC8305) to the Socket library
coe401_
1
220
From Spring Boot 2 to Spring Boot 3 with Java 22 and Jakarta EE
ivargrimstad
0
1.9k
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
44
4.7k
How STYLIGHT went responsive
nonsquared
93
5k
[RailsConf 2023] Rails as a piece of cake
palkan
35
4.4k
The Cost Of JavaScript in 2023
addyosmani
31
4.7k
What's new in Ruby 2.0
geeforr
338
31k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
12
3.8k
Scaling GitHub
holman
458
140k
Fashionably flexible responsive web design (full day workshop)
malarkey
399
65k
Facilitating Awesome Meetings
lara
46
5.8k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
26
2.1k
A Philosophy of Restraint
colly
200
16k
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