Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
【Swift】Extension 的延伸用法
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Richard Kao
November 04, 2016
Technology
290
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
【Swift】Extension 的延伸用法
extension(擴展)除了用在一些我們慣例的用途上,
它其實可以讓我們的 code 更易讀!
#實習 #公司分享會 #Swift
Richard Kao
November 04, 2016
Transcript
13 slides
Extension
硌疻疰ฎݻӞ㮆૪磪 ጱ觊獨牏奾䯤ڜ膐ࣳ獨 Ⴒے碝ۑ胼(functionality)
֕ᴻ種ԏक़牧 ਙ螭ݢ犥 ꔇꔇ
More Readable !!!!
Private Helper Functions 㼟*OUFSOBMGVODUJPO騈1SJWBUFGVODUJPOⴕ
private extension Something { // private ጱ䩚ᥜ㮉 }
Grouping 䪾GVODUJPOⴕⴽ겳䵩ꂂ."3,
extension Somthing { // 战蚤 Style 磪橕 } extension Something
{ // 战蚤 XXX 磪橕 }
Protocol Conformance 欽⢵$POGPSNUP1SPUPDPM䧴僽⢪欽1SPUPDPM酭涸GVODUJPO
extension Somthing: 礓Protocol { // Protocol ጱᥝ穩 }
Models 䪾鎙皿㿂䚍ㄤ⮭㶸㿂䚍ⴕ⢵
Struct 礓Model { // 㱪ਂ痀 } extension 礓Model { //
懯ᓒ痀 }
Others
More Decks by Richard Kao
See All by Richard Kao
【Swift】Protocol 命名 - Convertible
exp50000
1
220
【Swift】在 Protocol extension 內使用 Selector 發生的案例
exp50000
0
150
【Data】我所碰到的 JSON
exp50000
0
85
【iOS】Google Map SDK V.S. MapKit
exp50000
0
120
【iOS】View Hierarchy
exp50000
0
140
【iOS】Auto Layout
exp50000
0
64
【iOS】Clip Subviews
exp50000
0
100
【Swift】 Tutorial Resource
exp50000
0
72
Other Decks in Technology
See All in Technology
ノードが消える前提で設計する!Karpenterで金融システムを止めないためのノウハウ大全
daitak
1
250
RAGの改善を速く回すための評価基盤
yosukeyoshida
6
3.6k
コピーオンライト型ファイルシステムと ランダム書き込み
sat
PRO
2
140
自動計装なしでECSサービスをApplication Signalsに載せるまで
ota1022
2
470
個人ASを取得して、自宅Kubernetes上のVMをグローバルIPで公開した話
munenick
0
230
「正しいデータ」の定義をAI エージェントとつくるGoogleADKによるデータ品質定義の実践
takaha4k
0
130
Re:ゼロから始めるシェアハウスのペットな鯖
silmin_
0
270
攻撃と守りは何が変わり、何が変わらないのか~最近の不正アクセスから考える、リスク評価と標準の使いどころ
oidfj
2
320
AIフレンドリーなGenerative UIをJSXで
uhyo
2
120
Kubernetes, Agones, WebRTC, GPU で作る クラウドゲーミング基盤を本番運用に乗せるまで
vivion
0
270
設計手法を「道具」として使いこなすために
a_suenami
7
1.7k
共通基盤の実装に Kotlin - Quarkus を選定した理由と採用したアーキテクチャ
nealle
1
160
Featured
See All Featured
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
540
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
670
Exploring anti-patterns in Rails
aemeredith
4
580
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.4k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.5k
The agentic SEO stack - context over prompts
schlessera
0
1k
Crafting Experiences
bethany
1
460
Design in an AI World
tapps
1
400
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3.1k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
390
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.3k