So in iOS 7 I always got the Keyboard Window like this:
- (UIView *)keyboardView
{
UIWindow* tempWindow;
//Because we cant get access to the UIKeybo
I also had this problem and found the solution.
Below is the code which will work for iOS 8.0 and also for below versions.
I have tested it on iOS 7 and 8.0 (Xcode Version 6.0.1)
- (void)addButtonToKeyboard
{
// create custom button
self.doneButton = [UIButton buttonWithType:UIButtonTypeCustom];
self.doneButton.frame = CGRectMake(0, 163+44, 106, 53);
self.doneButton.adjustsImageWhenHighlighted = NO;
[self.doneButton setTag:67123];
[self.doneButton setImage:[UIImage imageNamed:@"doneup1.png"] forState:UIControlStateNormal];
[self.doneButton setImage:[UIImage imageNamed:@"donedown1.png"] forState:UIControlStateHighlighted];
[self.doneButton addTarget:self action:@selector(doneButton:) forControlEvents:UIControlEventTouchUpInside];
// locate keyboard view
int windowCount = [[[UIApplication sharedApplication] windows] count];
if (windowCount < 2) {
return;
}
UIWindow* tempWindow = [[[UIApplication sharedApplication] windows] objectAtIndex:1];
UIView* keyboard;
for(int i = 0 ; i < [tempWindow.subviews count] ; i++)
{
keyboard = [tempWindow.subviews objectAtIndex:i];
// keyboard found, add the button
if([[keyboard description] hasPrefix:@"
>
-(void) removedSearchButtonFromKeypad{
int windowCount = [[[UIApplication sharedApplication] windows] count];
if (windowCount < 2) {
return;
}
UIWindow* tempWindow = [[[UIApplication sharedApplication] windows] objectAtIndex:1];
for(int i = 0 ; i < [tempWindow.subviews count] ; i++)
{
UIView* keyboard = [tempWindow.subviews objectAtIndex:i];
if([[keyboard description] hasPrefix:@"
Hope this helps.