J'ai besoin de faire glisser le bouton dans mon tableau de bord que je peux faire glisser et déposer le bouton en utilisant le code suivantcomment rendre UIbutton draggable dans 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);
}
mais j'ai besoin tout en glisser-déposer i besoin de changer les positions des boutons trop
Note: i a écrit le code pour un seul bouton
s'il vous plaît aidez-moi à ma question