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
14
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
14
Kotlin 2.0.20 から標準ライブラリで UUID が使えるようになりました
ykws
1
210
コードの作者がいるうちに聞こう
ykws
2
460
アラートを効果的に扱おう
ykws
1
320
visionOS に備える
ykws
0
200
モバイルアプリの操作方法を疑ってみる
ykws
0
1.5k
Other Decks in Programming
See All in Programming
ソフトウェアの振る舞いに着目し 複雑な要件の開発に立ち向かう
rickyban
0
890
Go の GC の不得意な部分を克服したい
taiyow
2
770
Effective Signals in Angular 19+: Rules and Helpers @ngbe2024
manfredsteyer
PRO
0
130
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
700
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
300
return文におけるstd::moveについて
onihusube
1
900
ドメインイベント増えすぎ問題
h0r15h0
1
180
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
110
あれやってみてー駆動から成長を加速させる / areyattemite-driven
nashiusagi
1
200
Jakarta EE meets AI
ivargrimstad
0
230
これでLambdaが不要に?!Step FunctionsのJSONata対応について
iwatatomoya
2
3.6k
MCP with Cloudflare Workers
yusukebe
2
220
Featured
See All Featured
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
The Cult of Friendly URLs
andyhume
78
6.1k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
The Language of Interfaces
destraynor
154
24k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
Making the Leap to Tech Lead
cromwellryan
133
9k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
Embracing the Ebb and Flow
colly
84
4.5k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
The Cost Of JavaScript in 2023
addyosmani
45
7k
A Modern Web Designer's Workflow
chriscoyier
693
190k
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 ΞϓϦ։ൃͷείʔϓͰ͖ΔݶΓখ͘͞͠Α͏ • ։ൃظؒ • ੜଘظؒ • ػೳ
• εΫϥοϓˍϏϧυΛલఏʹܭը͠Α͏