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
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.8k
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
110
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
230
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
Webの技術スタックで マルチプラットフォームアプリ開発を可能にするElixirDesktopの紹介
thehaigo
2
1k
Figma Dev Modeで変わる!Flutterの開発体験
watanave
0
140
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
190
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
3
690
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
250
色々なIaCツールを実際に触って比較してみる
iriikeita
0
330
CSC509 Lecture 13
javiergs
PRO
0
110
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
130
Featured
See All Featured
Gamification - CAS2011
davidbonilla
80
5k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
Music & Morning Musume
bryan
46
6.2k
Producing Creativity
orderedlist
PRO
341
39k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
The Cost Of JavaScript in 2023
addyosmani
45
6.8k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Visualization
eitanlees
145
15k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
99
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
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 ΞϓϦ։ൃͷείʔϓͰ͖ΔݶΓখ͘͞͠Α͏ • ։ൃظؒ • ੜଘظؒ • ػೳ
• εΫϥοϓˍϏϧυΛલఏʹܭը͠Α͏