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 命名 - Convertible
Search
Richard Kao
October 21, 2016
Technology
180
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
260
【Swift】在 Protocol extension 內使用 Selector 發生的案例
exp50000
0
120
【Data】我所碰到的 JSON
exp50000
0
57
【iOS】Google Map SDK V.S. MapKit
exp50000
0
110
【iOS】View Hierarchy
exp50000
0
130
【iOS】Auto Layout
exp50000
0
59
【iOS】Clip Subviews
exp50000
0
75
【Swift】 Tutorial Resource
exp50000
0
64
Other Decks in Technology
See All in Technology
LanceDB入門
mocobeta
7
490
Model Studio CLI × Token Plan
maigo999
0
180
え?フロントエンドエンジニアの ワイがインフラも!?
puku0x
1
560
システム思考で問題に対処する
yussak
0
270
認知負荷をGemini で溶かす — GKE 基盤「Orbit」における AI エージェントの実践
sansantech
PRO
1
300
2026-08-05 IBM Z開発最前線!IBM Bob Premium Package for Zって何がすごいの?
yutanonaka
0
110
20260804_Q4AzureUpdateBite_FabricDataAgentの精度を高める設計.pdf
matayuuu
1
130
研究開発部の紹介 / Sansan R&D Profile
sansan33
PRO
4
24k
ホームラボ紹介
y_sera15
0
170
20260608_Codexの可能性_ノンプログラマー向け_大城追記
doradora09
PRO
0
800
Data Hubグループ 紹介資料
sansan33
PRO
0
3.2k
社内の7割が使うデータ基盤を、 データチーム2人で回すためにやったこと
koh_yoshi
4
1.3k
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Mind Mapping
helmedeiros
PRO
1
310
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
The Spectacular Lies of Maps
axbom
PRO
1
910
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
460
Navigating Team Friction
lara
192
16k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
480
Building the Perfect Custom Keyboard
takai
2
840
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.8k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
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 程式範例