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
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
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
120
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
1.1k
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
170
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
220
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
380
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
5.1k
APNsからLive Activityを開始する話
yumnumm
0
170
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
150
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
790
残高管理から台帳サービスへの進化
artoy
1
200
Vue Fes Japan の “作る側”に関わってみて
naokihaba
0
160
R8 の設定見直しでアプリサイズ削減
andpad
0
220
Featured
See All Featured
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
480
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
Git: the NoSQL Database
bkeepers
PRO
433
67k
ラッコキーワード サービス紹介資料
rakko
1
5.3M
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
Testing 201, or: Great Expectations
jmmastey
46
8.3k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
990
The Language of Interfaces
destraynor
162
27k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.4k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
370
Making the Leap to Tech Lead
cromwellryan
135
10k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
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