hide the keyboard when the IPad uses UIModalPresentationFormSheet
[passwordField resignFirstResponder];
@try
{
Class UIKeyboardImpl = NSClassFromString(@”UIKeyboardImpl”);
id activeInstance = [UIKeyboardImplperformSelector:@selector(activeInstance)];
[activeInstanceperformSelector:@selector(dismissKeyboard)];
}
@catch(NSException*exception)
{
NSLog(@”%@”, exception);
}
Hide keyboard when IPad uses UIModalPresentationFormSheet
Common practiceresignFirstResponder does not work when UIModalPresentationFormS
@try
< p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; line-height:normal; font-size:11px; font-family:Menlo"> {
Class UIKeyboardImpl = NSClassFromString(@”UIKeyboardImpl”);
id activeInstance = [UIKeyboardImplperformSelector:@selector(activeInstance)];
[activeInstanceperformSelector:@selector(dismissKeyboard)];
}
@ca tch(NSException*exception)
{
NSLog(@”%@”, exception);
}
Add the following code:
[passwordFieldresignFirstResponder];
@try
{
Class UIKeyboardImpl = NSClassFromString(@” UIKeyboardImpl”);
id activeInstance = [UIKeyboardImplperformSelector:@selector< /span>(activeInstance)];
[activeInstanceperformSelector:@selector(dismissKeyboard)];
}
@catch(NSException *exception)< /p>
{
NSLog(@”%@”, exception);
}