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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
55
【iOS】Google Map SDK V.S. MapKit
exp50000
0
100
【iOS】View Hierarchy
exp50000
0
120
【iOS】Auto Layout
exp50000
0
55
【iOS】Clip Subviews
exp50000
0
72
【Swift】 Tutorial Resource
exp50000
0
63
Other Decks in Technology
See All in Technology
Rubyで音を視る
ydah
1
110
protovalidate-es を導入してみた
bengo4com
0
150
Microsoft Build Keynoteふりかえり
tomokusaba
0
110
AgentGatewayを試してみたかった
tkikuchi
0
120
OCI Oracle AI Database Services新機能アップデート(2026/03-2026/05)
oracle4engineer
PRO
0
290
AI フレンドリーなエラー監視を TypeScript で実現する
shinyaigeek
2
270
[モダンアプリ勉強会]今更聞けないGit/GitHub入門
tsukuboshi
0
300
Amazon Bedrock AgentCore ワークショップ JAWS UG TOHOKU / amazon-bedrock-agentcore-workshop-jawsug-tohoku-2026
gawa
9
420
あなたの AI ワークスペースに、 専門コーダーを連れてくる - Amazon Quick Desktop 最新情報
kawaji_scratch
1
110
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
50k
Rancherの紹介&Update情報(RancherJP Online Meetup #09)
yoshiyuki_kono
0
130
AI-DLCを活用した高品質・安全なAI駆動開発実践 / AI Driven Development
yoshidashingo
1
380
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
37
7.3k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
320
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
330
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
190
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.5k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
The browser strikes back
jonoalderson
0
1.2k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
Making the Leap to Tech Lead
cromwellryan
135
9.9k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
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 程式範例