tengo que arrastrar y soltar el botón en mi tablero de instrumentos i puede arrastrar y soltar el botón utilizando el siguiente códigocómo hacer que el botón UI se pueda arrastrar dentro de UIView?
- (void)viewDidLoad {
[super viewDidLoad];
[eventButton addTarget:self action:@selector(draggedOut:withEvent:)forControlEvents:UIControlEventTouchDragOutside |UIControlEventTouchDragInside];
}
- (void) draggedOut: (UIControl *) c withEvent: (UIEvent *) ev {
CGPoint point = [[[ev allTouches] anyObject] locationInView:self.view];
if(point.y > 22 && point.y <300)
c.center = CGPointMake(237, point.y - c.bounds.size.height/2 -5);
}
pero necesito mientras que arrastrar y soltar tengo que cambiar las posiciones de los botones demasiado
nota: i escribió el código sólo por un botón
por favor me ayude a mi pregunta