Description
Using UIScrollViewKeyboardDismissMode added in iOS7, interactive keyboard operation became possible. But, it only works on UIScrollView. Keynode is able to interactive operate all inputView that appear as FirstResponder.
Keynode alternatives and similar libraries
Based on the "Keyboard" category.
Alternatively, view Keynode alternatives based on common mentions on social networks and blogs.
-
IQKeyboardManager
Codeless drop-in universal library allows to prevent issues of keyboard sliding up and cover UITextField/UITextView. Neither need to write any code nor any setup required and much more. -
KeyboardShortcuts
โจ๏ธ Add user-customizable global keyboard shortcuts (hotkeys) to your macOS app in minutes -
IHKeyboardAvoiding
IHKeyboardAvoiding is an elegant solution for keeping any UIView visible when the keyboard is being shown - no UIScrollView required!
CodeRabbit: AI Code Reviews for Developers

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Keynode or a related project?
README
Keynode
Why
Using UIScrollViewKeyboardDismissMode
added in iOS7, interactive keyboard operation became possible. But, it only works on UIScrollView
.
Keynode
is able to interactive operate all inputView
that appear as FirstResponder
.
Appetize's Demo
UITextField |
UITextField |
UIPickerView |
---|---|---|
Requirements
- Swift 4.2
- iOS 9.0 or later
How to Install
CocoaPods
Add the following to your Podfile
:
pod "Keynode"
Carthage
Add the following to your Cartfile
:
github "KyoheiG3/Keynode"
Usage
Function
func willAnimate(_ handler: @escaping (Bool, CGRect) -> Swift.Void) -> Keynode.Keynode
- To be called just before the animation.
func animations(_ handler: @escaping (Bool, CGRect) -> Swift.Void) -> Keynode.Keynode
- To be called when the display switching animation.
- It is also called at the time of the keyboard operation of the scroll gesture.
func onCompleted(_ handler: @escaping (Bool, UIResponder?, UIView?) -> Swift.Void) -> Keynode.Keynode
- To be called at the end animation.
func setResponder(responder: UIResponder)
- Can set the responder.
Variable
var isGesturePanningEnabled: Bool
- Set
false
if needn't pan the Keyboard with scrolling gesture. - Default is
true
.
var needsToChangeInsetAutomatically: Bool
- Set
false
if needn't change content inset ofUIScrollView
when opened the Keyboard. - Default is
true
.
var defaultInsetBottom: CGFloat
- Change bottom of
contentInset
if needed. - Default is
0
var gestureOffset: CGFloat
- Such as when there is a
toolbar
, you can specify the offset of when closing the keyboard with scroll gesture. - If the value is not set, the value specified in the
defaultInsetBottom
will be used.
Extension
extension NSNotification.Name {
static let UIResponderBecomeFirstResponder: Notification.Name
}
- Notification name for become first responder.
extension UIApplication {
func needsNotificationFromFirstResponder(_ from: Swift.AnyObject?)
}
- Receive the notification from first responder when the function executed.
Caution
- It might not work if the specification has been changed. however it will be solved in the earliest possible stage.
iOS9.0
~iOS12.0
is confirmed operation.
Acknowledgements
- Inspired by DAKeyboardControl in danielamitay.
Author
Kyohei Ito
Follow me ๐
LICENSE
Under the MIT license. See LICENSE file for details.
*Note that all licence references and agreements mentioned in the Keynode README section above
are relevant to that project's source code only.