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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Richard Kao
October 21, 2016
Technology
1
180
【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
120
【Data】我所碰到的 JSON
exp50000
0
53
【iOS】Google Map SDK V.S. MapKit
exp50000
0
100
【iOS】View Hierarchy
exp50000
0
120
【iOS】Auto Layout
exp50000
0
51
【iOS】Clip Subviews
exp50000
0
69
【Swift】 Tutorial Resource
exp50000
0
58
Other Decks in Technology
See All in Technology
プロポーザルに込める段取り八分
shoheimitani
1
270
15 years with Rails and DDD (AI Edition)
andrzejkrzywda
0
190
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
3k
AWS Network Firewall Proxyを触ってみた
nagisa53
1
230
学生・新卒・ジュニアから目指すSRE
hiroyaonoe
2
610
セキュリティについて学ぶ会 / 2026 01 25 Takamatsu WordPress Meetup
rocketmartue
1
300
20260204_Midosuji_Tech
takuyay0ne
1
160
Ruby版 JSXのRuxが気になる
sansantech
PRO
0
150
Data Hubグループ 紹介資料
sansan33
PRO
0
2.7k
ブロックテーマ、WordPress でウェブサイトをつくるということ / 2026.02.07 Gifu WordPress Meetup
torounit
0
180
Oracle Cloud Observability and Management Platform - OCI 運用監視サービス概要 -
oracle4engineer
PRO
2
14k
CDK対応したAWS DevOps Agentを試そう_20260201
masakiokuda
1
290
Featured
See All Featured
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
220
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Designing for Performance
lara
610
70k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Mind Mapping
helmedeiros
PRO
0
86
Unsuck your backbone
ammeep
671
58k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
120
Prompt Engineering for Job Search
mfonobong
0
160
WENDY [Excerpt]
tessaabrams
9
36k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.1k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
180
Scaling GitHub
holman
464
140k
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 程式範例