Hi everybody,
I found out there is something new in the iPhone SDK 3.2 which is (UITextField class) :
inputView: The custom input view to display when the text field becomes the first responder. If the value in this property is nil, the text field displays the standard system keyboard when it becomes first responder. Assigning a custom view to this property causes that view to be presented instead. The default value of this property is nil.
inputAccessoryView: The custom accessory view to display when the text field becomes the first responder. The default value of this property is nil. Assigning a view to this property causes that view to be displayed above the standard system keyboard (or above the custom input view if one is provided) when the text field becomes the first responder. For example, you could use this property to attach a custom toolbar to the keyboard.
This would allow us to implement our own keyboard but still having the cursor, cut-copy-past, etc... Unfortunately, iPhone OS 3.2 is iPad only ...
Quote:
Originally Posted by StatCoder
Also, be aware that Apple is flagging apps that use "keyboardDidShow:" as an undocumented API.
|
I dont' see how "keyboardDidShow:" can be an undocumented API, it's just a method that could be given another name =/. It just answers to the UIKeyboardWillShowNotification notification which is public.
If Apple's warning is about the use of UIKeyboard then I think we can completely hide the window containing the keyboard so we don't make any calls to a UIKeyboard object :
Code:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
// ...
}
- (void)keyboardWillShow:(NSNotification *)note
{
// To hide the keyboard you can hide the window
// that contains the keyboard (description starts
// by "<UITextEffectsWindow") or hide the keyboard
// itself (description starts by "<UIKeyboard" or
// "<UIPeripheralHostView" on the iPad").
NSArray* windows = [[UIApplication sharedApplication] windows];
NSUInteger windowCount = [windows count];
// Going through each window of our application
for (NSUInteger i = 0; i < windowCount; i++)
{
/* Hidding the window containing the keyboard */
UIWindow* currentWindow = [windows objectAtIndex:i];
if ([[currentWindow description] hasPrefix:@"<UITextEffectsWindow"])
{
[currentWindow setHidden:YES];
}
/* Print some information (windows & their subviews) ... */
NSArray* currentWindowSubviews = [currentWindow subviews];
NSUInteger subViewCount = [currentWindowSubviews count];
NSLog(@"Window #%u : %@", i, currentWindow);
for (NSUInteger j = 0; j < subViewCount; j++)
{
NSLog(@" View #%u : %@", j, [currentWindowSubviews objectAtIndex:j]);
}
}
}
Do you think this would be rejected ?
Thanks

.