


DestinationView.swift: view that sits on top of the upper section of the window - it will be the recipient of your drag actions.StickerBoardViewController.swift: the main view controller.You’ll edit four specific files as you work through this tutorial, and they’re in two places: Dragging Destinations and Dragging Sources: Two smaller views that you’ll turn into different dragging sources.The sticker view where you’ll drag images and other things.There are three parts to the project window:

All you need to do is learn about the mechanics of drag and drop. To keep you focused on the objective - building out support for dragging and dropping - the starter project comes complete with the views you’ll require. You can drag images onto a surface and then you can kick things up a few notches by adding sparkles and unicorns to the view.Īfter all, who doesn’t like unicorns and sparkles? :] Many kids enjoy playing with stickers and making cool collages with them, so you’re going to build an app that features this experience. Download the starter project, open it in Xcode and build and run it. This project uses Swift 3 and requires, at a minimum, Xcode 8 beta 6.

Try it and you might be pleasantly surprised by the actions and types supported by your favorite apps. You get the point, right? It’s cool and an integral part of the macOS experience.ĭrag and drop has come a long way from its beginnings and now you can drag almost anything anywhere. You can drag your latest sunset panorama from Photos and drop it in Messages, or pull a file from Downloads on the dock and drop it right in an email. The quintessential example is in Finder, where you can drag files around to organize things or drop them in the trash. Ever since the invention of the Mac, drag and drop has been a part of the user interface.
