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
Escaping Closures in Swift - 公司內分享會
Search
Li-Hsuan Chen
September 23, 2016
Programming
1
210
Escaping Closures in Swift - 公司內分享會
Li-Hsuan Chen
September 23, 2016
Tweet
Share
More Decks by Li-Hsuan Chen
See All by Li-Hsuan Chen
The UX thinking of PAY ID
vc7
2
410
From Onboarding to Value Delivering in iOS
vc7
0
230
Merciless Refactoring
vc7
0
690
Protocol 的實例、測試和心得
vc7
2
750
共有経済
vc7
0
160
.gitignore
vc7
1
75
Git Workshop 03
vc7
0
110
Git Workshop 02
vc7
0
93
Git Workshop 01
vc7
0
150
Other Decks in Programming
See All in Programming
.NET のための通信フレームワーク MagicOnion 入門 / Introduction to MagicOnion
mayuki
1
1.4k
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
470
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
480
エンジニアとして関わる要件と仕様(公開用)
murabayashi
0
280
みんなでプロポーザルを書いてみた
yuriko1211
0
260
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
1.9k
WebフロントエンドにおけるGraphQL(あるいはバックエンドのAPI)との向き合い方 / #241106_plk_frontend
izumin5210
4
1.4k
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
600
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
230
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
120
Jakarta EE meets AI
ivargrimstad
0
130
RubyLSPのマルチバイト文字対応
notfounds
0
120
Featured
See All Featured
Become a Pro
speakerdeck
PRO
25
5k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
The Pragmatic Product Professional
lauravandoore
31
6.3k
A better future with KSS
kneath
238
17k
A designer walks into a library…
pauljervisheath
203
24k
The Invisible Side of Design
smashingmag
298
50k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Transcript
&TDBQJOH$MPTVSFT ꤫խ愴蠩 @escaping
䖰ㆭ酭鷗鷗ㆭ酭
殹DMPTVSF⡲捀侸⫄Ⰵ♧⦐NFUIPE儘 鸏⦐DMPTVSF剚㖈NFUIPE㛂遤㸤䧭䖕 䩞剚鄄㛂遤儘㽠䗳갭䭸㹁䧭FTDBQJOHDMPTVSF
⾲㨥䞕㞯 雊䧮⦛⢵䢩䢩⸈匌銯
class A { func someMethod(closure: () -> Void) { closure()
} } 鸏♧媯♶剚剤DPNQJMFSFSSPS
䞕㞯♧ 鸏⦐DMBTT剤⦐荈㹁纏涸RVFVF ⢵嶋⻋♶ずNFUIPE⫄Ⰵ涸DMPTVSFT
class A { var closures: [() -> Void]? = []
func someMethod(closure: () -> Void) { self.closures?.append(closure) } } 㖈4XJGUⴀ⢵⟃鸏媯♶剚剤㉏겗
class A { var closures: [() -> Void]? = []
func someMethod(closure: () -> Void) { self.closures?.append(closure) } }
None
class A { var closures: [() -> Void]? = []
func someMethod(closure: @escaping () -> Void) { self.closures?.append(closure) } }
㼭穡 • @escaping ˖ ⫄ⰅNFUIPE涸DMPTVSF㥶卓銴㖈NFUIPE GVODUJPO涸SFUVSO䖕䩞㛂遤㽠䗳갭銴⸈♳ @escaping ˖ @noescapeJNQMJDJUMZ ˖
DMPTVSF⡲捀侸갸鏤鿪僽@noescape
䞕㞯✳ 䧮欽痧♲倰MJCSBSZ涸NFUIPE FH"MBNPSF
〫銴➮剤FTDBQJOH ⡹㽠銴騈衽!FTDBQJOH
class B { var closures: [() -> Void]? = []
func anotherMethod(closure: @escaping () -> Void) { self.closures?.append(closure) } }
class A { func someMethod(closure: () -> Void) { B().anotherMethod(closure:
closure) } } class B { var closures: [() -> Void]? = [] func anotherMethod(closure: @escaping () -> Void) { self.closures?.append(closure) } } 㖈4XJGUⴀ⢵⟃鸏垺㻨♶剚剤㉏겗
class A { func someMethod(closure: () -> Void) { B().anotherMethod(closure:
closure) } } class B { var closures: [() -> Void]? = [] func anotherMethod(closure: @escaping () -> Void) { self.closures?.append(closure) } }
None
class A { func someMethod(closure: @escaping () -> Void) {
B().anotherMethod(closure: closure) } } class B { var closures: [() -> Void]? = [] func anotherMethod(closure: @escaping () -> Void) { self.closures?.append(closure) } }
籏穡♧♴
䖰ㆭ酭鷗鷗ㆭ酭
鷗ⴀ㛂遤涸眕㕠
Ⱖ➮ ˖ 〳⟃鍑对SFUBJODZDMF涸㉏겗 4& 䖊㻜뀿 ˖ OPFTDBQFDMPTVSFTIBWFBMTPBMXBZTCFFOUIF QSFGFSSFEEFGBVMU
TJODFUIFZFMJNJOBUFBDMBTT PGSFUBJODZDMFJTTVFT ˖ QSPUPDPM涸㹁纏 ˖ 㥶卓㻜⡲QSPUPDPM涸倰岁儘銴⸈!FTDBQJOH QSPUPDPM⚥鑪倰岁涸㹁纏⛳銴⸈♳
5IBOL:PV