Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dismissing keyboard in content controller when sliding left and back again #108

Open
ptclarke opened this issue Jan 22, 2014 · 1 comment

Comments

@ptclarke
Copy link

Have a problem with keyboard dismissal in a content controller. Resolved but not sure it is the best way:

Scenario: default segue slides to content controller with 3 text fields, tap on any text field, keyboard appears. Tap on done, keyboard disappears, tap on any text field, keyboard appears. Slide to left menu controller, keyboard still appears as editing has not ended in the content controller.

Solution in left menu controller (slide delegate) is to end editing in the content controller on slideMenuWillSlideToSide as follows:
// end editing and ensure keyboard hidden on visible controller
-(void) slideMenuWillSlideToSide:(UINavigationController *)selectedContent{
if ([[[selectedContent visibleViewController] view] respondsToSelector:@selector(endEditing:)]){
[[[selectedContent visibleViewController] view] endEditing:YES];
}
}

Would appreciate advice, Must be missing something, surely managing the keyboard must be easier than this.....

@stefanoa
Copy link
Owner

It should be simpler, I am looking at it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants