Created
August 12, 2013 21:38
-
-
Save abronte/6215533 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| + (void)keyboard:(ForgeTask*)task { | |
| [[NSNotificationCenter defaultCenter] addObserverForName:@"UIKeyboardCandidateCorrectionDidChangeNotification" object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { | |
| UIWindow *keyboardWindow = nil; | |
| for (UIWindow *testWindow in [[UIApplication sharedApplication] windows]) { | |
| if (![[testWindow class] isEqual:[UIWindow class]]) { | |
| keyboardWindow = testWindow; | |
| } | |
| } | |
| // Locate UIWebFormView. | |
| for (UIView *possibleFormView in [keyboardWindow subviews]) { | |
| // iOS 5 sticks the UIWebFormView inside a UIPeripheralHostView. | |
| [[possibleFormView layer] setMasksToBounds:YES]; | |
| if ([[possibleFormView description] rangeOfString:@"UIPeripheralHostView"].location != NSNotFound) { | |
| for (UIView *subviewWhichIsPossibleFormView in [possibleFormView subviews]) { | |
| if ([[subviewWhichIsPossibleFormView description] rangeOfString:@"UIWebFormAccessory"].location != NSNotFound) { | |
| [subviewWhichIsPossibleFormView removeFromSuperview]; | |
| } | |
| } | |
| } | |
| } | |
| }]; | |
| [task success:nil]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment