uikeyboard

Detect when keyboard is fully visible and prevent keyboard appearance handling code from adding extra offset for hidden element

纵饮孤独 提交于 2021-01-29 05:41:02
问题 I want to know if the keyboard is fully visible and not if it's in in-between states of presentation. Unfortunately, all the answers use UIKeyboardDidShow , UIKeyboardWillShow , or UIKeyboardWillChangeFrame to check if keyboard is visible. All of these trigger listeners multiple times as the keyboard appears. So I can't use any of them to definitively tell if the keyboard is fully visible. I want to know if the keyboard is fully visible and prevent an action from triggering in my

Smoothly scrolling tableview up by fixed constant when keyboard appears so last cells are still visible

不羁岁月 提交于 2021-01-28 21:11:57
问题 When the keyboard appears, I am shifting the bottom-most view up by a constant. But due to this the hight of the UITableView also reduces and the cells that were previously visible are no longer visible. What I want to do is scroll the table view up by a height equal to the keyboard's height so that at least the last messages will be visible like they were before the keyboard appeared. The last yellow cell that was half-visible in the image on left should be visible like that on the right too

Remove keyboard notification when ViewController disappears

让人想犯罪 __ 提交于 2021-01-27 22:11:28
问题 How can I remove keyboard notification? I put observer on keyboard open and close. I change the view size depend on keyboard is open or close. 回答1: Try this to remove keyboard open show observers, NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillShow, object: nil) NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillHide, object: nil) you should remove observers either in deinit Or viewDidDisappear as per your

Grey out return key programmatically

妖精的绣舞 提交于 2020-08-26 10:45:49
问题 I am looking to enable the return key of a UITextField keyboard if (and only if) the user inputs a valid email address. I have tried a solution that dates back from 2009 which uses the private method setReturnKeyEnabled . Unfortunately, this method does not seem to exist anymore: No known instance method for selector 'setReturnKeyEnabled:' How can I programmatically enable and disable the return key of a keyboard? 回答1: All the other solutions do not answer the question. OP wants to "gray" out

iOS: How to detect keyboard change event

怎甘沉沦 提交于 2020-08-26 05:22:47
问题 Xcode 9.2, iOS 10.0+ , swift4. I'm working on a project where user inputs english characters in UITextField and it converted to Japanese language characters. and it is working perfect. now, i want to allow user to input Japanese language characters direct from Japanese Keyboard.In this situation i want to know that the keyboard is changed from default to another type/language. So, is there any function or Notification is available that can help me? 回答1: You can use the

How do you disable a 3rd party keyboard in your iOS app

好久不见. 提交于 2020-06-25 18:36:25
问题 Can you disable 3rd party keyboards in iOS? If so, how? 回答1: Add this method to your UIApplicationDelegate -(BOOL)application:(UIApplication *)application shouldAllowExtensionPointIdentifier:(NSString *)extensionPointIdentifier { if (extensionPointIdentifier == UIApplicationKeyboardExtensionPointIdentifier) { return NO; } return YES; } 回答2: Swift 5.1 Add to AppDelegate.Swift: func application(application: UIApplication, shouldAllowExtensionPointIdentifier extensionPointIdentifier: String) ->

Keyboard Issue in Landscape Orientation - Xcode - Swift

情到浓时终转凉″ 提交于 2020-05-13 18:16:12
问题 I have a Share extension for my iOS app and the extension requires the use of a keyboard. It seems as though I cannot control the orientation of the view controller of the extension, so when the device is put in landscape mode, the keyboard turns sideways, but off the screen. This makes it so that the user cannot use the keyboard when in landscape mode. How can I change the coordinates of the keyboard on screen, and how do I detect the orientation of the device? I am perplexed by this issue

Unexpected error on adding a button action in the Keyboard Extension

孤街浪徒 提交于 2020-02-06 07:57:54
问题 I'm developing a little app and I want to implement a responder function when a button is clicked in a view (ExtraView) inside the Keyboard Extension. Unfortunatelly it has been impossible to me due to the following errors that appear whhen I push the button (the apps doesn't crashes but the functionality implemented for the button doesn't works): 2020-01-31 03:27:36.724821+0100 MyApp[1841:354840] [lifecycle ] [u F8708363-74FE-4BA6-B64F-7DA7B719F80D:m (null)] [MyApp.Keyboard(1.0)] Connection

iOS 13 update broke my app's keyboard on its first display

随声附和 提交于 2020-01-30 11:25:29
问题 I'm updating an app developed for iOS 8 (kinda old), but I'm having issues on the first time the keyboard is being displayed after recent iOS 13 update: Keyboard appears as an effect of calling [textfield becomeFirstResponder], regardless if it's being called explicitly in the code (into the viewDidLoad method) or implicitly when the field is tapped, but only occurs the first time it appears after the view itself appears. I'm "solving" it calling [textfield becomeFirstResponder] and