SwiftUI & macOS: Drag Files Into Dock

Grace Huang
4 min readNov 15, 2023

In this tutorial, we will walk through a macOS example demonstrating how to drag files into an app icon in the dock. This functionality becomes useful when you need to drag content from anywhere on the screen to an area consistently anchored on the screen.

Dragging images into the app icon in the dock

(My latest book “macOS App Development: The SwiftUI Way” is now available. Grab your copy today!)

Prerequisites

--

--

Grace Huang

I write about startups, entrepreneurship, investing, software, hardware and manufacturing.