Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Swift - Protocol oriented programming
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Nanang Rafsanjani
September 25, 2015
Programming
770
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Swift - Protocol oriented programming
Perkenalan Swift - Protocol oriented programming
Nanang Rafsanjani
September 25, 2015
More Decks by Nanang Rafsanjani
See All by Nanang Rafsanjani
Introduction to Realm
jukiginanjar
0
50
iOS Architecture & Pattern
jukiginanjar
0
48
Other Decks in Programming
See All in Programming
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
5.2k
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
260
パスワード再設定メールのURLについて知っておこう
uyuki234
0
160
複雑なUIコンポーネントとの ⻑い付き合い⽅:波及するバグからテスト戦略を経て、安全な再設計へ
mixplace
0
430
最近”作らせてる” ローカルAIアプリの話
akit37
0
470
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
170
golang-bob.pdf
iwatsukayura
0
130
TechTown - Creating Composable Callables in Contemporary C++
rollbear
0
130
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
120
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
610
sbt 2.0: takeoff
eed3si9n
0
160
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
320
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
How to build a perfect <img>
jonoalderson
1
6.1k
Ethics towards AI in product and experience design
skipperchong
2
430
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
410
From π to Pie charts
rasagy
1
400
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
550
Music & Morning Musume
bryan
48
7.4k
BBQ
matthewcrist
90
10k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
Done Done
chrislema
187
17k
Transcript
Protocol Oriented Programming in Swift
"Crusty" is an old-school programmer who doesn't trust IDE's, debuggers
and he doesn’t do OOP
Classes are Awesome • Encapsulation • Access Control • Abstraction
• Namespace • Expressive Syntax • Extensibility
Classes are Awesome • Encapsulation • Access Control • Abstraction
• Namespace • Expressive Syntax • Extensibility You can do all that with structs and enums!
Classes are Awesome Inheritance
Classes are Awesome Inheritance
Classes are Awesome Inheritance
Crusty's 3 complaints about classes 1. Implicit sharing 2. Inheritance
is too intrusive 3. Lost type relationships
Implicit Sharing
Implicit Sharing
Implicit Sharing
Inheritance too intrusive • You can only have 1 super
class • Bloating your super class • If superclass have stored properties ◦ You have to accept them, which bloat it ◦ You have to initialize it ◦ Make sure that you understand how to interact with your superclass
Lost Type Relationships
Protocol Solves the Problems