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
【Ebisu.mobile#3】バイトルアプリへのSwift Concurrency導入とその効果
Search
Cychow
July 05, 2023
Programming
3
340
【Ebisu.mobile#3】バイトルアプリへのSwift Concurrency導入とその効果
Cychow
July 05, 2023
Tweet
Share
More Decks by Cychow
See All by Cychow
【Qiita Night】新卒エンジニアによるSwift6与太予想
eiji127
0
360
Other Decks in Programming
See All in Programming
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
250
Amazon S3 NYJavaSIG 2024-12-12
sullis
0
100
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
380
nekko cloudにおけるProxmox VE利用事例
irumaru
3
430
fs2-io を試してたらバグを見つけて直した話
chencmd
0
230
선언형 UI에서의 상태관리
l2hyunwoo
0
160
ゆるやかにgolangci-lintのルールを強くする / Kyoto.go #56
utgwkk
2
390
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1.2k
DevFest Tokyo 2025 - Flutter のアプリアーキテクチャ現在地点
wasabeef
5
910
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
420
創造的活動から切り拓く新たなキャリア 好きから始めてみる夜勤オペレーターからSREへの転身
yjszk
1
130
HTTP compression in PHP and Symfony apps
dunglas
2
1.7k
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Six Lessons from altMBA
skipperchong
27
3.5k
Adopting Sorbet at Scale
ufuk
73
9.1k
Agile that works and the tools we love
rasmusluckow
328
21k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
The Pragmatic Product Professional
lauravandoore
32
6.3k
Making the Leap to Tech Lead
cromwellryan
133
9k
GitHub's CSS Performance
jonrohan
1030
460k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
111
49k
Transcript
όΠτϧΞϓϦͷSwift Concurrency ಋೖͱͦͷޮՌ Eiji Shirakazu, iOS Engineer in dip
ࣗݾհ ന ӥ࢘ / Eiji Shirakazu @cychow_app όΠτϧ iOSΞϓϦ։ൃ୲ ࠷ۙVision
Pro (visionOS)ͷγϛϡϨʔλͰ༡ΜͰ͍·͢ʂ
None
ຊͷ༰ όΠτϧΞϓϦͷ͝հͱ։ൃपΓͷ͓ ͦͦSwift Concurrencyͱ Swift ConcurrencyΛͲͷΑ͏ʹಋೖ͔ͨ͠ Swift Concurrencyಋೖޙͷঢ়گ
όΠτϧΞϓϦͱ… ɾΞϧόΠτ/ύʔτٻਓݕࡧαʔϏε ɾ෯͍͔༷ͭʑͳ݅ͷΞϧόΠτ/ύʔτใɹ ɹΛଟ͘ܝࡌʂ ɾࣸਅಈըͳͲ͔ΒΞϧόΠτ/ύʔτઌͷ੍ಇ͍ͯ ɹ͍Δελοϑɺ৬ͷงғؾͳͲΛ֬ೝ͢Δ͜ͱ͕Ͱ͖Δʂ
ʮॳճΠϯετʔϧޙͷମݧ্ʯػೳʹ͍ͭͯ εϓϥογϡ ٻਓͷҰཡ
ʮॳճΠϯετʔϧޙͷମݧ্ʯػೳʹ͍ͭͯ εϓϥογϡ Ϣʔβʔͷ࣭
ʮॳճΠϯετʔϧޙͷମݧ্ʯػೳͷ։ൃͰ Swift ConcurrencyΛಋೖʂʂ
Swift Concurrencyͱ WWDC21ʹͯొͨ͠৽ͨͳฒߦॲཧͷख๏ async/awaitΩʔϫʔυΛ༻͍Δ͜ͱͰඇಉظॲཧ / ฒߦॲཧΛ࣮ݱ͢Δ async/awaitҎ֎ʹActorTaskɺAsyncStreamͳͲͷ֓೦ొ
None
None
Swift ConcurrencyΛͲͷΑ͏ʹಋೖ͔ͨ͠ ᶃ ·͕ͣࣗੵۃతʹConcurrencyʹ͍ͭͯΠϯϓοτͨ͠ ᶄ ಋೖ͢Δ͜ͱʹͲΕ͘Β͍ͷϝϦοτ͕͋Δ͔Λߟͨ͠
ɾඇಉظॲཧΛಉظॲཧͷΑ͏ʹදه͢Δ͜ͱͰ࣮ߦॱংΛ͍͍͢ Swift ConcurrencyΛಋೖ͢ΔϝϦοτ ɾσʔλڝ߹Λճආ͘͢͠ͳΔ ɾiOS13Ҏ߱Ͱ༻͢Δ͜ͱ͕Ͱ͖Δ ɾΤϥʔϋϯυϦϯάΛߦ͍͘͢ͳΔ ͳͲ…
Swift ConcurrencyΛͲͷΑ͏ʹಋೖ͔ͨ͠ ᶅ ઌഐΤϯδχΞͷํʑͱ૬ஊ͠ɺαʔϏεʹ༩͑ΔӨڹΛߟ্ྀͨ͠Ͱಋೖ ɹ͍ͯ͘͜͠ͱʹͨ͠ ᶃ ·͕ͣࣗੵۃతʹConcurrencyʹ͍ͭͯΠϯϓοτͨ͠ ᶄ ಋೖ͢Δ͜ͱʹͲΕ͘Β͍ͷϝϦοτ͕͋Δ͔Λߟͨ͠ ᶆ
Өڹൣғ͕খ͍͞ʮॳճΠϯετʔϧޙͷମݧʯΛ্ͤ͞ΔϓϩδΣΫτ ɹʹͯಋೖ͢Δ͜ͱͱͨ͠
ɾcompletionHandlerΛ༻͍ͣɺasync/awaitΛ༻͍ͯදه͢Δɻ ɾGCDΛ༻͢ΔՕॴΛTaskʹஔ͖͑Δɻ ɾMainActorΛࢦఆ͢ΔՕॴʹҙ͢Δɻ Swift ConcurrencyΛಋೖ࣌ͷϙΠϯτ ɾwithCheckedContinuationwithCheckedThrowingContinuationͰ ɹطଘͷඇಉظॲཧΛasync/awaitʹରԠͤ͞Δ͜ͱ͕Ͱ͖Δɻ ͳͲ
ͨͩɺ…
໘ͨ͠ ଞͷ։ൃνʔϜϝϯόʔ৽نࢀըऀͷํʹରͯ͠Concurrencyͷ ॻ͖ํͳͲΛͬͯΒ͏ඞཁ͕͋ͬͨɻ
ͷղܾࡦ LTେձࢀՃ
Swift Concurrencyಋೖޙͷঢ়گ ɾιʔείʔυͷՄಡੑ্͕ͨ͠ ɾνʔϜϝϯόʔ͕ੵۃతʹΩϟονΞοϓ͢ΔΑ͏ʹͳͬͨ ʲݱঢ়ʳ ɾαʔυύʔςΟϥΠϒϥϦ͔Βඪ४ϥΠϒϥϦʹҠߦ͢Δ͜ͱ͕Ͱ͖͍ͯΔ
Swift Concurrencyಋೖޙͷঢ়گ ɾSwift6ͷϝδϟʔΞοϓσʔτͷ४උ ʲࠓޙͷ՝ʳ
None
Swift Concurrencyಋೖޙͷঢ়گ ɾࠓޙͷSwift6ͷϝδϟʔΞοϓσʔτͷ४උ ɾίϯύΠϥϑϥάʮStrict Concurrency CheckingʯͷಋೖͳͲݕ౼ ʲࠓޙʳ
ίϯύΠϥϑϥάʮStrict Concurrency Checkingʯ
ίϯύΠϥϑϥάʮExistentialAnyʯಋೖݕ౼த….
Swift Concurrencyಋೖޙͷঢ়گ ɾࠓޙͷSwift6ͷϝδϟʔΞοϓσʔτͷ४උ ɾίϯύΠϥϑϥάʮStrict Concurrency CheckingʯͷಋೖͳͲݕ౼ ɾSendableͷ४ڌͷνΣοΫͳͲ͓͜ͳ͍͖͍ͬͯͨ ʲࠓޙʳ
όΠτϧͰҾ͖ଓ͖ٕज़తઓΛଓ͚͍͖ͯ·͢ʂ
None