I want to have several objects that I can drag and drop.
Here\'s my code for moving one object (with lot of help from @vacawama):
import UIKit
class Vie
The way a gesture recognizer works is that you attach it to a view. So if you have multiple views, and you want them to be draggable in the same way, attach a different pan gesture recognizer to each one.
Now let's say you want them all to have the same action handler. No problem. In the action handler, you receive the current gesture recognizer as a parameter. It has a view
property; that's the view it is attached to! So now you know that that's the view you're moving.