Type Safely

Type Safely

Drag And Drop SwiftUI Views With The .onDrop Modifier

Daily Coding Tip 066

Millie Sturgeon's avatar
Millie Sturgeon
Apr 19, 2022
∙ Paid
Image by Joshua Woroniecki from Pixabay

We’re going to start with what is possibly the most complicated part.

The delegate for receiving something that’s been dragged and dropped is appropriately named DropDelegate. The main thing we’re doing is storing the value of the text that was dropped. If you’re unfamiliar with UTTypes, they basically specify file…

User's avatar

Continue reading this post for free, courtesy of Type Safely.

Or purchase a paid subscription.
© 2026 Type Safely · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture