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
1
170
【Swift】Protocol 命名 - Convertible
當我們把 protocol 命名為 ”某某Convertible“ 代表了什麼?
是誰轉換成誰?
什麼轉換成什麼?
怎麼應用,來看看
#實習 #公司分享會 #Swift
Richard Kao
October 21, 2016
Tweet
Share
More Decks by Richard Kao
See All by Richard Kao
【Swift】Extension 的延伸用法
exp50000
0
250
【Swift】在 Protocol extension 內使用 Selector 發生的案例
exp50000
0
110
【Data】我所碰到的 JSON
exp50000
0
49
【iOS】Google Map SDK V.S. MapKit
exp50000
0
99
【iOS】View Hierarchy
exp50000
0
100
【iOS】Auto Layout
exp50000
0
48
【iOS】Clip Subviews
exp50000
0
67
【Swift】 Tutorial Resource
exp50000
0
56
Other Decks in Technology
See All in Technology
作曲家がボカロを使うようにPdMはAIを使え
itotaxi
0
330
なぜ私はいま、ここにいるのか? #もがく中堅デザイナー #プロダクトデザイナー
bengo4com
0
1.2k
生成AI時代の開発組織・技術・プロセス 〜 ログラスの挑戦と考察 〜
itohiro73
1
350
20250625 Snowflake Summit 2025活用事例 レポート / Nowcast Snowflake Summit 2025 Case Study Report
kkuv
1
360
生成AI時代 文字コードを学ぶ意義を見出せるか?
hrsued
1
680
rubygem開発で鍛える設計力
joker1007
2
260
PHP開発者のためのSOLID原則再入門 #phpcon / PHP Conference Japan 2025
shogogg
4
910
プロダクトエンジニアリング組織への歩み、その現在地 / Our journey to becoming a product engineering organization
hiro_torii
0
130
モバイル界のMCPを考える
naoto33
0
190
米国国防総省のDevSecOpsライフサイクルをAWSのセキュリティサービスとOSSで実現
syoshie
2
1.2k
MySQL5.6から8.4へ 戦いの記録
kyoshidaxx
1
290
Prox Industries株式会社 会社紹介資料
proxindustries
0
340
Featured
See All Featured
Code Review Best Practice
trishagee
69
18k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
48
5.4k
Embracing the Ebb and Flow
colly
86
4.7k
Making the Leap to Tech Lead
cromwellryan
134
9.4k
Git: the NoSQL Database
bkeepers
PRO
430
65k
Thoughts on Productivity
jonyablonski
69
4.7k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Rails Girls Zürich Keynote
gr2m
94
14k
It's Worth the Effort
3n
185
28k
GraphQLとの向き合い方2022年版
quramy
49
14k
How GitHub (no longer) Works
holman
314
140k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.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 程式範例