I was wondering if there is anyway to delay the keyboard popping up when you click on a UITextView? I have a UITextView at the bottom of the screen. When they user clicks on it The delegate method is called that brings forward the keyboard. I created an animation that moves the UITextView to the top of the screen but the keyboard comes on so quickly that the animation of the textView is not smooth.
If I could delay the pop up until the animation finishes that would be a great look. Since it is a delegate method that brings forward the keyboard I don't know if I could delay it 1/2 a second. Here is the code
If I could delay the pop up until the animation finishes that would be a great look. Since it is a delegate method that brings forward the keyboard I don't know if I could delay it 1/2 a second. Here is the code
Code:
- (void)textViewDidBeginEditing:(UITextView *)textView{
fadeBlackTimer= [NSTimer scheduledTimerWithTimeInterval:.01 target:self selector:@selector(fadeToBlack) userInfo:nil repeats:YES];
NSLog(@"Time for update");
self.navigationItem.rightBarButtonItem.enabled = YES;
}
-(void)fadeToBlack{
fadeToBlackView.alpha += fadeBlack;
notesTextView.center = CGPointMake(self.view.center.x, self.view.center.y - moveTextView);
if (moveTextView < 99) {
moveTextView += 2;
}
NSLog(@"move: %d",moveTextView);
if (fadeToBlackView.alpha > 1.4) { // 1.4 allows extra time for animation of TextView.
[fadeBlackTimer invalidate];
fadeToBlackView.alpha = 1.0;
moveTextView = 2;
}
}