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
24
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
19
Kotlin 2.0.20 から標準ライブラリで UUID が使えるようになりました
ykws
1
210
コードの作者がいるうちに聞こう
ykws
2
480
アラートを効果的に扱おう
ykws
1
330
visionOS に備える
ykws
0
210
モバイルアプリの操作方法を疑ってみる
ykws
0
1.5k
Other Decks in Programming
See All in Programming
盆栽転じて家具となる / Bonsai and Furnitures
aereal
0
1.8k
『改訂新版 良いコード/悪いコードで学ぶ設計入門』活用方法−爆速でスキルアップする!効果的な学習アプローチ / effective-learning-of-good-code
minodriven
28
4.1k
カンファレンス動画鑑賞会のススメ / Osaka.swift #1
hironytic
0
170
良いユニットテストを書こう
mototakatsu
11
3.6k
EC2からECSへ 念願のコンテナ移行と巨大レガシーPHPアプリケーションの再構築
sumiyae
3
590
テストコード書いてみませんか?
onopon
2
340
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
8
1.9k
PHPカンファレンス 2024|共創を加速するための若手の技術挑戦
weddingpark
0
140
HTML/CSS超絶浅い説明
yuki0329
0
190
GitHub CopilotでTypeScriptの コード生成するワザップ
starfish719
26
6k
AWSのLambdaで PHPを動かす選択肢
rinchoku
2
390
月刊 競技プログラミングをお仕事に役立てるには
terryu16
1
1.2k
Featured
See All Featured
jQuery: Nuts, Bolts and Bling
dougneiner
62
7.6k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Embracing the Ebb and Flow
colly
84
4.5k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.5k
Side Projects
sachag
452
42k
KATA
mclloyd
29
14k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
230
52k
Being A Developer After 40
akosma
89
590k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
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 ΞϓϦ։ൃͷείʔϓͰ͖ΔݶΓখ͘͞͠Α͏ • ։ൃظؒ • ੜଘظؒ • ػೳ
• εΫϥοϓˍϏϧυΛલఏʹܭը͠Α͏