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
15
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
php-conference-japan-2024
tasuku43
0
290
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
110
テストコード書いてみませんか?
onopon
2
110
命名をリントする
chiroruxx
1
410
Security_for_introducing_eBPF
kentatada
0
110
[JAWS-UG横浜 #76] イケてるアップデートを宇宙いち早く紹介するよ!
maroon1st
0
460
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
230
tidymodelsによるtidyな生存時間解析 / Japan.R2024
dropout009
1
780
DevFest Tokyo 2025 - Flutter のアプリアーキテクチャ現在地点
wasabeef
5
910
rails statsで大解剖 🔍 “B/43流” のRailsの育て方を歴史とともに振り返ります
shoheimitani
2
930
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
330
Fibonacci Function Gallery - Part 1
philipschwarz
PRO
0
220
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
520
Become a Pro
speakerdeck
PRO
26
5k
RailsConf 2023
tenderlove
29
940
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
For a Future-Friendly Web
brad_frost
175
9.4k
Done Done
chrislema
181
16k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
The Pragmatic Product Professional
lauravandoore
32
6.3k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
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 ΞϓϦ։ൃͷείʔϓͰ͖ΔݶΓখ͘͞͠Α͏ • ։ൃظؒ • ੜଘظؒ • ػೳ
• εΫϥοϓˍϏϧυΛલఏʹܭը͠Α͏