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
SwiftUI Drag & Drop で困った話
Search
KAWASHIMA Yoshiyuki
November 13, 2024
Programming
0
9
SwiftUI Drag & Drop で困った話
【Sansan × YUMEMI】iOSランチタイムLT
https://yumemi.connpass.com/event/333140/
KAWASHIMA Yoshiyuki
November 13, 2024
Tweet
Share
More Decks by KAWASHIMA Yoshiyuki
See All by KAWASHIMA Yoshiyuki
GitHub PR Milestone Check を使ってみた
ykws
0
10
Kotlin 2.0.20 から標準ライブラリで UUID が使えるようになりました
ykws
1
190
コードの作者がいるうちに聞こう
ykws
2
440
アラートを効果的に扱おう
ykws
1
310
visionOS に備える
ykws
0
190
モバイルアプリの操作方法を疑ってみる
ykws
0
1.5k
Other Decks in Programming
See All in Programming
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
1.9k
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
最新TCAキャッチアップ
0si43
0
140
現場で役立つモデリング 超入門
masuda220
PRO
15
3.2k
Macとオーディオ再生 2024/11/02
yusukeito
0
370
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
230
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
2
660
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
距離関数を極める! / SESSIONS 2024
gam0022
0
280
subpath importsで始めるモック生活
10tera
0
300
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
100
Featured
See All Featured
Navigating Team Friction
lara
183
14k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
What's new in Ruby 2.0
geeforr
343
31k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
A Philosophy of Restraint
colly
203
16k
How GitHub (no longer) Works
holman
310
140k
Done Done
chrislema
181
16k
Typedesign – Prime Four
hannesfritz
40
2.4k
Transcript
ʲSansan ✖ YUMEMIʳiOSϥϯνLT 2024.11.14 SwiftUI Drag & Drop Ͱࠔͬͨ KAWASHIMA
Yoshiyuki
͍͑ͨ͜ͱ • iOS ΞϓϦ։ൃ͍͠
λʔήοτ OS ʁ
iOS ΞϓϦ։ൃ͍͠
͍ͯ͘͠͠ΔͷԿʁ
iOS ͕ಘҙͱ͍ͯ͠Δͷ
εΫϥοϓˍϏϧυ
Ӭ͘ϝϯςφϯε͞ΕΔͷۤख
։ൃظ͕͍ؒͱͦΕ͚ͩͰ ϛεϚον͕ൃੜ͍͢͠
લఏ iOS ΞϓϦͷػೳͱͯ͠ Drag & Drop Λ࣮͢Δ͜ͱʹͳͬͨ SwiftUI ϕʔεͰ iOS
17 Ҏ্Λλʔήοτ
https://developer.apple.com/documentation/swiftui/drag-and-drop
https://developer.apple.com/documentation/swiftui/making-a-view-into-a-drag-source
https://developer.apple.com/documentation/swiftui/drag-and-drop
https://developer.apple.com/documentation/swiftui/drag-and-drop
https://developer.apple.com/documentation/CoreTransferable/Transferable
https://developer.apple.com/documentation/CoreTransferable/Transferable
https://developer.apple.com/documentation/CoreTransferable/Transferable
https://developer.apple.com/documentation/swiftui/drag-and-drop
https://developer.apple.com/documentation/swiftui/drag-and-drop
https://developer.apple.com/jp/design/Human-Interface-Guidelines/drag-and-drop
https://developer.apple.com/documentation/swiftui/view/draggable(_:)
https://developer.apple.com/documentation/swiftui/view/draggable(_:)
https://developer.apple.com/tutorials/app-dev-training/supporting-drag-and-drop/
Drag & Drop ϋϯυϦϯά͕Ͱ͖ͳ͍
https://developer.apple.com/documentation/swiftui/making-a-view-into-a-drag-source
https://developer.apple.com/documentation/swiftui/making-a-view-into-a-drag-source
https://developer.apple.com/documentation/swiftui/making-a-view-into-a-drag-source
https://developer.apple.com/documentation/swiftui/view/dropdestination(for:action:istargeted:)
https://developer.apple.com/documentation/swiftui/view/dropdestination(for:action:istargeted:)
https://developer.apple.com/documentation/swiftui/view/dropdestination(for:action:istargeted:)
͏গ͠ϋϯυϦϯά͍ͨ͠
https://developer.apple.com/documentation/swiftui/drag-and-drop
https://developer.apple.com/documentation/swiftui/drag-and-drop
https://developer.apple.com/documentation/foundation/nsitemprovider
https://developer.apple.com/documentation/foundation/nsitemprovider
https://developer.apple.com/documentation/foundation/nsitemprovider
https://developer.apple.com/documentation/swiftui/view/ondrag(_:preview:)
https://developer.apple.com/documentation/swiftui/view/ondrag(_:preview:)
https://developer.apple.com/documentation/swiftui/dropdelegate
DragDelegate ͳ͍
ͬͱϋϯυϦϯά͍ͨ͠
https://developer.apple.com/documentation/swiftui/dropdelegate
https://developer.apple.com/documentation/swiftui/dropdelegate
https://developer.apple.com/documentation/swiftui/draggesture
https://developer.apple.com/documentation/swiftui/draggesture
https://developer.apple.com/documentation/swiftui/draggesture
https://developer.apple.com/documentation/swiftui/draggesture
https://developer.apple.com/documentation/swiftui/composing-swiftui-gestures
https://developer.apple.com/documentation/swiftui/composing-swiftui-gestures
https://developer.apple.com/documentation/swiftui/composing-swiftui-gestures
https://developer.apple.com/documentation/swiftui/composing-swiftui-gestures
https://developer.apple.com/documentation/swiftui/composing-swiftui-gestures
https://developer.apple.com/documentation/swiftui/composing-swiftui-gestures
SwiftUI Drag & Drop ซ༻Ͱ͖ͳ͍ API ࣮ ϋϯυϦϯά iOS 16
draggable/dropDestination ෆཁ Ͱ͖ͳ͍ iOS 14 onDrag/onDrop Ұ෦ඞཁ DropͰ͖Δ iOS 13 DragGesture શͯ Ͱ͖Δ
SwiftUI Drag & Drop Λ͍ͯ͘͠͠Δͷ • બࢶ͕͋ͬͯࣗ༝Ͱ͋Δ • ҰํͰλʔήοτ OS
ʹΑ੍ͬͯݶ͕͋Δ • OS ʹΑͬͯৼΔ͍͕ҧ͏ • API ͕ෆશʹײ͡Δ • ͷΓ͚அج४͕ఆ·Γʹ͍͘
OS ʹΑͬͯҟͳΔৼΔ͍ • ScrollView + LazyVGrid + dropDestination • υϥοάͨ͠ΞΠςϜΛεΫϩʔϧͯ͠ҰϑϨʔϜΞτͨ͠
dropDestination ʹυϩοϓ͕Ͱ͖ͳ͍ • iOS 17.5 Ͱൃੜ͢Δ • iOS 18 Ͱൃੜ͠ͳ͍ • Lazy ΛΊͯ Stack ͰΊղফͰ͖Δ
·ͱΊ • iOS ΞϓϦ։ൃͷείʔϓͰ͖ΔݶΓখ͘͞͠Α͏ • ։ൃظؒ • ੜଘظؒ • ػೳ
• εΫϥοϓˍϏϧυΛલఏʹܭը͠Α͏