I have the text field at the bottom of the screen. When the user taps it, the text field should animate up allowing room for the keyboard such as the iOS message app does. Anyway when this occurs, the animation is not happening correctly. Instead of going to where I specify (160, 410), It goes off the screen and right back on and then goes to where I specify. This causes it to look delayed and the keyboard goes up first. Here is my code: 

```
- (void)viewDidLoad {
    [super viewDidLoad];

    textField1.delegate = self;
}

- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
[UIView animateWithDuration:0.5 animations:^
 {
     [dock setCenter:CGPointMake(160, 410)];
 }
                 completion:^(BOOL finished)
 {
     [dock setCenter:CGPointMake(160, 410)];
 }];

return YES;
}

```