UIInputViewController's dismissKeyboard does not always work

Originator:and.mikhaylov
Number:rdar://23672205 Date Originated:26-Nov-2015 07:50 PM
Status:Open Resolved:
Product:iOS Product Version:iOS 9.0.2
Classification:Serious Bug Reproducible:Always
 
Summary:
UIInputViewController. dismissKeyboard does not always dismiss the keyboard. If standard keyboard is displayed first then all other custom input view controllers work fine, but if custom input view controller displayed first then dismissKeyboard does nothing. Keyboard seems to play some role in permanently fixing this, so I believe there is some inconsistency in UIInputViewController that breaks for custom input view controllers.

Steps to Reproduce:
1. Create UIView subclass and override the following methods:

@property (nonatomic, readwrite, strong) UIInputViewController *inputViewController;
@property (nonatomic, readwrite, strong) UIInputViewController *inputAccessoryViewController;

- (BOOL)canBecomeFirstResponder {
    return YES;
}

2. Create and set custom input view controller for that view
3. Call becomeFirstResponder on custom view to trigger keyboard view with custom input view controller inside
4. Call dismissKeyboard on it

Expected Results:
Controller being dismissed

Actual Results:
Nothing happens.

Regression:
Describe circumstances where the problem occurs or does not occur, such as software versions and/or hardware configurations.

Notes:
Workaround is to use:

[[UIApplication sharedApplication] sendAction:@selector(resignFirstResponder) to:nil from:nil forEvent:nil];

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!