Type Safely

Type Safely

Share this post

Type Safely
Type Safely
Drag And Drop SwiftUI Views With The .onDrop Modifier
Copy link
Facebook
Email
Notes
More

Drag And Drop SwiftUI Views With The .onDrop Modifier

Daily Coding Tip 066

Millie Sturgeon's avatar
Millie Sturgeon
Apr 19, 2022
∙ Paid

Share this post

Type Safely
Type Safely
Drag And Drop SwiftUI Views With The .onDrop Modifier
Copy link
Facebook
Email
Notes
More
Share
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…

Keep reading with a 7-day free trial

Subscribe to Type Safely to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Type Safely
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share

Copy link
Facebook
Email
Notes
More