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 命名 - Convertible
Search
Richard Kao
October 21, 2016
Technology
200
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
【Swift】Protocol 命名 - Convertible
當我們把 protocol 命名為 ”某某Convertible“ 代表了什麼?
是誰轉換成誰?
什麼轉換成什麼?
怎麼應用,來看看
#實習 #公司分享會 #Swift
Richard Kao
October 21, 2016
More Decks by Richard Kao
See All by Richard Kao
【Swift】Extension 的延伸用法
exp50000
0
270
【Swift】在 Protocol extension 內使用 Selector 發生的案例
exp50000
0
130
【Data】我所碰到的 JSON
exp50000
0
69
【iOS】Google Map SDK V.S. MapKit
exp50000
0
110
【iOS】View Hierarchy
exp50000
0
140
【iOS】Auto Layout
exp50000
0
60
【iOS】Clip Subviews
exp50000
0
82
【Swift】 Tutorial Resource
exp50000
0
66
Other Decks in Technology
See All in Technology
全人類(ほぼ)AWS Organizations の上でAWSを利用している、その世界を知る話
htan
1
130
"優秀な誰か"の下位互換にならないために
yut0naga1_fa
0
1.4k
Running Kotlin + Quarkus with Lambda
nealle
0
150
V8のArray.prototype.flatを最大約20倍速くするまでと、巨大OSSへの大規模コミットの道のり
riyaamemiya
0
130
事業活動を AI Ready にする攻めと守りのデータエンジニアリング / data-engineering-for-ai-ready-business
pei0804
7
2.4k
検証フェーズはAIの回答を判断するための学習機会
toru_kubota
2
570
会社説明資料
persolserverworks
0
9.7k
オンラインゲームのシステム全体像 - コロプラ 2026年度 新卒研修
colopl
0
1.1k
AI時代のAPI開発を加速する品質ガードレール / API Quality Guardrails in the AI Era
yokawasa
0
170
Claude Code本は、どのように執筆チームで書かれたか
oikon48
1
360
Cognition AI Japan - ウェビナー2_テストQA_運用監視
cogakira
0
120
全PRの83%が AIレビューだけでマージできるようになった開発組織は その後どうなったか @2026/10
athug
0
130
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Google's AI Overviews - The New Search
badams
0
1.6k
Discover your Explorer Soul
emna__ayadi
2
1.3k
Practical Orchestrator
shlominoach
192
12k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
720
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
It's Worth the Effort
3n
188
29k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
340
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
590
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
260
How to make the Groovebox
asonas
2
2.5k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
Transcript
Convertible
protocol SomeTypeConver t i b l e ‘ Can Be
’
Subject? Object? SomeType can be converted to object Subject can
be converted to SomeType 誰 主 詞 ︖ 誰 受 詞 ︖
Ⰽ罏涼〳腋
• NilLiteralConvertible • BooleanLiteralConvertible • IntegerLiteralConvertible • FloatLiteralConvertible • StringLiteralConvertible
• UnicodeScalarLiteralConvertible • ExtendedGraphemeClusterLiteralConvertible Ex.
protocol IntegerLiteralConvertible { associatedtype IntegerLiteralType init(integerLiteralValue value: Self.IntegerLiteralType) }
Comfort to 以上 Convertible 的型別 可以把 SomeType 轉換成 ᛔ૩ጱࣳ獨
DeMo 程式範例
Ex. Alamofire R o u t e r • URLStringConvertible
• URLRequestConvertible
public protocol URLRequestConvertible { /// The URL request. var URLRequest:
NSMutableURLRequest { get } }
Comfort to 以上 Convertible 的型別 可以把 ᛔ૩ጱࣳ獨 轉換成 SomeType
DeMo 程式範例