uikeyboard

iPhone/iPad keyboard shortcuts?

為{幸葍}努か 提交于 2019-12-19 02:56:04
问题 There's an action in my program which users need to perform very frequently (potentially hundreds of times per session), and I'd like to add a keyboard shortcut for users with a bluetooth keyboard. Is there any way to do this? Right now, the closest I've come is triggering the action whenever the U+F8FF character is entered ( Shift + Alt + k on an iPad/iPhone/Mac, which prints an apple logo character) in a text view. Of course, this would present an issue if the user actually wanted to input

UIKeyboardWillShowNotification not called for an undocked keyboard in iOS 5

只愿长相守 提交于 2019-12-18 14:53:32
问题 I have found that UIKeyboardWillShowNotification and UIKeyboardDidShowNotification are not generated when an undocked/split keyboard appears in iOS 5 . For instance, tap into a text field to show the keyboard (notifications are generated), undock the keyboard, tap out of the text field to dismiss the keyboard, tap on the text field again to show the undocked keyboard (notifications are not generated). Is there any way to detect when the keyboard appears regardless of whether it is docked or

UIKeyboardWillShowNotification not called for an undocked keyboard in iOS 5

…衆ロ難τιáo~ 提交于 2019-12-18 14:53:07
问题 I have found that UIKeyboardWillShowNotification and UIKeyboardDidShowNotification are not generated when an undocked/split keyboard appears in iOS 5 . For instance, tap into a text field to show the keyboard (notifications are generated), undock the keyboard, tap out of the text field to dismiss the keyboard, tap on the text field again to show the undocked keyboard (notifications are not generated). Is there any way to detect when the keyboard appears regardless of whether it is docked or

Synchronizing Animations in keyboardWillShow keyboardWillHide — Hardware Keyboard & Virtual Keyboard Simultaneously

房东的猫 提交于 2019-12-18 11:50:08
问题 Preamble So I have an application featuring a chat section, and I'm synchronizing the animation of the keyboard hiding and showing with the rise and fall of the chat input. Here's the code I'm using: SHOW: - (void) keyboardWillShow:(NSNotification *)note { NSDictionary *keyboardAnimationDetail = [note userInfo]; UIViewAnimationCurve animationCurve = [keyboardAnimationDetail[UIKeyboardAnimationCurveUserInfoKey] integerValue]; CGFloat duration = [keyboardAnimationDetail

How to detect when user changes keyboards?

拟墨画扇 提交于 2019-12-18 10:32:27
问题 Is there some way to detect when the user changes keyboard types, specifically to the Emoji keyboard in this case? 回答1: You can use UITextInputMode to detect the current language of the currentInputMode -- emoji is considered a language. From the docs: An instance of the UITextInputMode class represents the current text-input mode. You can use this object to determine the primary language currently being used for text input. You can test for the emoji keyboard like this: NSString *language =

iPad 'dismiss keyboard' button doesn't dismiss keyboard

笑着哭i 提交于 2019-12-18 09:48:35
问题 I have a UITextField in a Landscape view, and when I press the 'dismiss keyboard' button in the lower right of the UIKeyboard view, the keyboard does NOT disappear. Is there a way to programmatically listen for when this key was pressed? Or is there a connection I am not seeing that will make this keyboard go away? This is iOS 4 and XCode 4. Thanks. 回答1: I had same problem today and I wondered, wy it works in Apple's KeyboardAccessory Sample Code. So I did reverse engineering. The

unexpectedly found nil while unwrapping an Optional value keyboardWillShow

一曲冷凌霜 提交于 2019-12-18 07:10:20
问题 I have this code below which runs when the keyboardWillShowNotification is called: func keyboardWillShow(_ notification: Notification) { //ERROR IN THE LINE BELOW keyboard = (notification.userInfo?[UIKeyboardFrameEndUserInfoKey] as AnyObject).cgRectValue animaton = (notification.userInfo?[UIKeyboardAnimationDurationUserInfoKey] as AnyObject).doubleValue UIView.animate(withDuration: 0.4, animations: { () -> Void in self.scrollView.frame.size.height = self.scrollViewHeight - self.keyboard

How does one disable third party keyboards in Swift?

混江龙づ霸主 提交于 2019-12-18 04:05:08
问题 Basically that's it, I haven't found a way to disable third party keyboard in my app, although I know it's possible 'cos I've seen it in apps like 1Password. Any ideas? 回答1: Add this code in your AppDelegate func application(application: UIApplication, shouldAllowExtensionPointIdentifier extensionPointIdentifier: String) -> Bool { if extensionPointIdentifier == UIApplicationKeyboardExtensionPointIdentifier { return false } return true } Swift 4: func application(_ application: UIApplication,

Keyboard handling just like in Messages app in iOS 7

大兔子大兔子 提交于 2019-12-18 03:33:18
问题 I am implementing a view that is in some way similar to what happens in Messages app, so there is a view with UITextView attached to the bottom of the screen and there is also UITableView showing the main content. When it is tapped it slides up with the keyboard and when keyboard is dismissed it slides back to the bottom of the screen. That part I have and it is working perfectly - I just subscribed to keyboard notifications - will hide and wil show. The problem is that I have set keyboard

UIKeyboardTypeNumberPad without a done button

假装没事ソ 提交于 2019-12-18 02:47:56
问题 How can we implement UIKeyboardTypeNumberPad so that it will have a 'done' button? By default it does not have one. 回答1: If I am not wrong then You want to ask as to how to add a custom "Done" button to keyboard for UIKeyboardTypeNumberPad . In that case this might be helpful. Declare a UIButton *doneButton in.h and add the following code to .m file - (void)addButtonToKeyboard { // create custom button if (doneButton == nil) { doneButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 163,