Question

I have a subclass of a UItableViewCell

When a user touches a CELL, I call reload, like this:

[_tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];

// This is where magic happens...
[_tableView beginUpdates];
[_tableView endUpdates];

And a new cell takes shows up. This new cell becomes the first responder for the _workName UITextField, like this:

@implementation TWMainViewPlusExpandedCell

- (void) awakeFromNib
{        
    [_workName becomeFirstResponder];

}

The keyboard shows up, but without animation. It's instant! There seems to be no animation whatsoever!

However, when I resign the keyboard, by calling resignFirstResponder, it resigns with animation, as expected.

Am I missing something here?

Thank you!

Was it helpful?

Solution

I think your cell becomes responder and brings up keyboard before or during the tableview animation caused by reload. Try

- (void) awakeFromNib
{        
    [_workName performSelector:@selector(becomeFirstResponder) onThread:[NSThread getMainThread] withObject:nil withDelay:0.1];

}

I question why you are reloading the table just to select a cell.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top