i am using UITextField on my UIView and need to drag UITextField with my pointer on my UIView but its not working!! here is my code:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
[UIView beginAnimations:@"Move" context:nil];
[UIView setAnimationDuration:1];
[UIView setAnimationBeginsFromCurrentState:YES];
UITouch *touch = [[event allTouches] anyObject];
mytextField.center = [touch locationInView:myView];
[UIView commitAnimations]; }
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch *touch = [touches anyObject];
mytextField.center = [touch locationInView:myView];}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{}
Why you have taken animation in touches began.I think just comment code of touches began and try it will work.