Sorry, but I have not had time before. I think you want to be able to move the elements where you want inside the screen and also work when you tap. I have something that I did once but it is in ObjC, I hope that this is what you want and that it will serve you. Basically you have to add the pan gesture to the view to be able to move what is in it. You must have access to the items in the view, I use a singleton to save, since I could have 2 or 30, you could also browse the items in the view
UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(hacenPan:)];
[self.view addGestureRecognizer:pan];
Now you have to do the bread action. For this you should go recognizing the states and save the item that you are moving
-(void)hacenPan:(UIPanGestureRecognizer *)pan{
static Figura *f;
//compruebo los estados del pan para saber si esta comenzando o terminando...
if ( pan.state == UIGestureRecognizerStateChanged) {
//se esta moviendo
CGPoint currentPosition = [pan locationInView:self.view];
if ( f ) {
CGRect fr=f.shape.frame;
fr.origin.x=currentPosition.x;
fr.origin.y=currentPosition.y;
f.shape.frame=fr;
}
} else if ( pan.state == UIGestureRecognizerStateBegan) {
//comienza el pan, busco la figura que hay debajo
CGPoint inicio =[pan locationInView:self.view];
//comprobar si el punto pertenece a alguna vista existente
f=[ArraySingleton buscaFiguraConElPunto:inicio];
} else if ( pan.state == UIGestureRecognizerStateEnded) {
//termino el pan, elimino la fogura que tuviera guardada
f=nil;
}
}
This what it does is when it begins to recognize the bread, it looks for where it has started and if there is a Figure in those coordinates. You should go saving somewhere where each figure is. I have it in a singleton because I decided so, but you can be an array in the controller or whatever you want and from there I have to keep the figure that you want to move, since this event will be called many times, so when move the anger finger by UIGestureRecognizerStateChanged and that's where you move the item to the new position of the finger, with this you can drag the items on the screen and stay where you lift your finger.
In my case I always used the same type, which is Figure.
I hope that it is what you were looking for and that it will serve you