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
Escaping Closures in Swift - 公司內分享會
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Lihsuan Chen
September 23, 2016
Programming
280
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Escaping Closures in Swift - 公司內分享會
Lihsuan Chen
September 23, 2016
More Decks by Lihsuan Chen
See All by Lihsuan Chen
iPlayground 2025 - 接⼿ 10年⼤雜燴:專案現代化與產品開發的挑戰
vc7
0
210
The UX thinking of PAY ID
vc7
2
520
From Onboarding to Value Delivering in iOS
vc7
0
320
Merciless Refactoring
vc7
0
840
Protocol 的實例、測試和心得
vc7
2
860
共有経済
vc7
0
220
.gitignore
vc7
1
130
Git Workshop 03
vc7
0
160
Git Workshop 02
vc7
0
150
Other Decks in Programming
See All in Programming
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.6k
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
160
残高管理から台帳サービスへの進化
artoy
1
200
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
1
2.3k
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
22
22k
Embedded Swiftで作る自作USBデバイス によるiOSデバイスの自動テスト / iOSDC Japan 2026 glassfiber
glassfiber
0
330
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
1
170
Kotlinの15年とServer-Side Kotlin
n_takehata
1
120
Simple Storage Service(S3) is not simple
iwatsukayura
0
270
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
110
ActionController meets Protocol Buffers
sorah
0
200
mrbgem 三角測量 開発
ogom
0
240
Featured
See All Featured
The Cult of Friendly URLs
andyhume
79
7k
Building the Perfect Custom Keyboard
takai
2
900
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
530
A better future with KSS
kneath
240
18k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
320
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
360
The SEO Collaboration Effect
kristinabergwall1
1
590
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
630
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
260
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