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
56
【iOS】Google Map SDK V.S. MapKit
exp50000
0
100
【iOS】View Hierarchy
exp50000
0
120
【iOS】Auto Layout
exp50000
0
57
【iOS】Clip Subviews
exp50000
0
74
【Swift】 Tutorial Resource
exp50000
0
64
Other Decks in Technology
See All in Technology
オブザーバビリティ、本当に活用できてる? 〜API連携×生成AIで成熟度を自動評価〜
dmmsre
1
3.6k
Type-safe IaC for Dart
coborinai
0
160
変更し続けられるシステムをどう保つか — AI時代のSSoTという設計原則
kawauso
0
210
ヘルスケア領域における AI 活用と その安全性担保のための取り組み (Leveraging AI in Healthcare and Our Efforts to Ensure Its Safety) - Google I/O Extended Tokyo 2026, July 11, 2026
zettaittenani
0
430
凡エンジニアがこの先生きのこるためには。〜TypeScript完全に理解したい〜
alchemy1115
2
310
AmplifyHostingConstructからSSRフレームワークのためのホスティング設計を考察する/amplify-hosting-construct
fossamagna
1
240
SRE Next 2026 何でも屋からの脱却
bto
0
1k
最適な自走を最小限の支援で — M&Aで拡大する組織で少人数SREが挑んだ1年 / SRE NEXT 2026
genda
0
1.5k
プロダクト開発組織の現在地(Ver.2026/07) / product-organization
kaonavi
0
120
「AIに依存している」と 「AIを使いこなしている」の違い
k8yasuma
0
120
インシデント事例と パッケージの全量解析に学ぶ ソフトウェアサプライチェーンの守り方 / supply-chain-attack-defense
flatt_security
0
110
Data + AI Summit 2026 イベントレポート: 「AIがビジネスで意思決定するデータ基盤」へ
nek0128
0
280
Featured
See All Featured
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
67
56k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1k
We Have a Design System, Now What?
morganepeng
55
8.2k
How to train your dragon (web standard)
notwaldorf
97
6.7k
Designing for Timeless Needs
cassininazir
1
370
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
350
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
550
Tell your own story through comics
letsgokoyo
1
1k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.6k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
220
Designing for humans not robots
tammielis
254
26k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.3k
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 程式範例