CommonKeyboard
An elegant Keyboard library for iOS. simple, lightweight and standalone no sub-dependencies required.
Installation
CocoaPods
Add the following to your Podfile
pod 'CommonKeyboard'
Carthage
Add the following to your Cartfile
github "kaweerutk/CommonKeyboard"
Usage
In AppDelegate.swift, just import CommonKeyboard
framework and enable CommonKeyboard.
CommonKeyboard
will automatically scroll to the input view when the cursor focused and tapping on a space to dismiss keyboard. This working with UIScrollView and all inheritance classes including UITableView and UICollectionView
(Note: This does not support UITableViewController
because it will handle by itself)
Adjust an offset between keyboard and input view by set keyboardOffset
the default value is 10, Or ignore common keyboard by giving ignoredCommonKeyboard
a true value.
CommonKeyboardObserver
You can subscribe CommonKeyboardObserver
to get keyboard notification info.
All events
Sometimes there are many UIScrollView containers in UI Stack View and the CommonKeyboard cannot find the right one you can implement CommonKeyboardContainerProtocol
and return specific container
Others
Requirements
- iOS9 or later
- Swift 4.2 or later