Skip to content

Instantly share code, notes, and snippets.

@abronte
Created August 12, 2013 21:38
Show Gist options
  • Select an option

  • Save abronte/6215533 to your computer and use it in GitHub Desktop.

Select an option

Save abronte/6215533 to your computer and use it in GitHub Desktop.
+ (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