Go to https://squarespace.com/seanallen to save 10% off your first purchase of a website or domain using code SEANALLEN.
Drag an drop in SwiftUI was revamped in iOS 16. It now uses the .draggable and .dropDestination modifiers which require conformance to the new Transferable protocol in Swift. In this video we create a kanban board to teach you how to use Drag and Drop. In the second half of the video I show you how to conform your custom objects to Transferable so you can use them with Drag and Drop.
Starter Project Download:
https://www.dropbox.com/sh/lbrtbnd5mk...
Human Interface Guidelines - Drag and Drop:
https://developer.apple.com/design/hu...
WWDC 2022 - Meet Transferable:
https://developer.apple.com/videos/pl...
WWDC 2020 - Uniform Type Identifiers:
https://developer.apple.com/videos/pl...
My iOS Dev Courses:
https://seanallen.teachable.com/
Twitter:
Sean Allen - / seanallen_dev
Hired.com:
https://hired.com/x/1n01g
Book and learning recommendations that help out the channel if you decide to purchase (Affiliate Links):
Paul Hudson's Hacking With Swift:
https://gumroad.com/a/762098803
Donny Wals - Combine:
https://gumroad.com/a/909014131
Mark Moeyken’s SwiftUI Books:
www.bigmountainstudio.com/swiftui-views-book/fzc51
Objc.io Books (Thinking in SwiftUI & Advanced Swift):
https://gumroad.com/a/656585843
Timestamps:
0:00 - Drag and Drop in iOS 16
0:32 - Starter Project Overview
1:21 - Strings vs. Custom Object
1:52 - Draggable
4:25 - Drop Destination
7:21 - Drag and Drop copy by default
7:51 - Remove tasks from starting array
9:03 - Remove duplicates from destination
10:43 - Highlight drop target on hover
13:28 - Drag and Drop basics review
17:01 - Create Custom Object
18:18 - Conform to Transferable
20:06 - Custom Uniform Type Identifier
22:23 - Adapt code with new Transferable type
25:39 - Wrong drop target type example
26:25 - Did you enjoy that?
#swift #softwaredeveloper #iosdeveloper
Смотрите видео SwiftUI Drag and Drop with Transferable Custom Object онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал Sean Allen 20 Июль 2023. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 22,246 раз и оно понравилось 647 посетителям.