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
Swift - Protocol oriented programming
Search
Nanang Rafsanjani
September 25, 2015
Programming
0
750
Swift - Protocol oriented programming
Perkenalan Swift - Protocol oriented programming
Nanang Rafsanjani
September 25, 2015
Tweet
Share
More Decks by Nanang Rafsanjani
See All by Nanang Rafsanjani
Introduction to Realm
jukiginanjar
0
42
iOS Architecture & Pattern
jukiginanjar
0
45
Other Decks in Programming
See All in Programming
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
220
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
110
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
200
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
300
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
5.9k
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
960
Basic Architectures
denyspoltorak
0
660
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
990
CSC307 Lecture 07
javiergs
PRO
0
550
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
690
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
130
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
630
Featured
See All Featured
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
430
AI: The stuff that nobody shows you
jnunemaker
PRO
2
240
How STYLIGHT went responsive
nonsquared
100
6k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
640
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
300
Documentation Writing (for coders)
carmenintech
77
5.2k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
The Curse of the Amulet
leimatthew05
1
8.3k
The Curious Case for Waylosing
cassininazir
0
230
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