Sunday, 2 February 2014

Move button through coding

viewcontroller.h
 IBOutlet UIButton *button;

viewController.m

-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
    UITouch *touch=[[event allTouches]anyObject];
    button.center=[touch locationInView:self.view];

}

No comments:

Post a Comment