Keyboard TextField Manager
Often while developing an app, We ran into an issues where the iPhone UIKeyboard slide up and cover the UITextField/UITextView.
Screen Shot
Video
Installation
Cocoapod
IQKeyboardManager is available through CocoaPods, to install it simply add the following line to your Podfile:
pod 'IQKeyboardManager', '~>3.0.0'
Framework:-
Link your project against KeyboardManager.framework found in "IQKeyboardManager Framework" directory. Drag and drop the resource bundle IQKeyboardManager.bundle found in same directory. add -ObjC flag in other linker flag. That's it. No need to write any single line of code.
Source Code:-
Just drag and drop IQKeyBoardManager directory from demo project to your project. That's it. No need to write any single line of code. It will enable automatically.
Properties and functions usage:-
-
+sharedManagerReturns the default singleton instance. -
enableUse this to enable/disable managing distance between keyboard & textField/textView). -
keyboardDistanceFromTextFieldSet Distance between keyboard & textField. Can't be less than zero. Default is 10. -
enableAutoToolbarEnable autoToolbar behaviour. If It is set to NO. You have to manually create UIToolbar for keyboard. Default is YES. -
canAdjustTextViewGiving permission to modify TextView's frame. Adjust textView's frame when it is too big in height. Default is NO. -
shouldResignOnTouchOutsideResign textField if touched outside of UITextField/UITextView. -
shouldShowTextFieldPlaceholderIf YES, then it add the textField's placeholder text on IQToolbar. Default is YES. -
shouldPlayInputClicksIf YES, then it plays inputClick sound on next/previous/done click. Default is NO. -
toolbarUsesCurrentWindowTintColorIf YES, then uses textField's tintColor property for IQToolbar, otherwise tintColor is black. Default is NO. -
toolbarManageStyleSetting toolbar behaviour to IQAutoToolbarBySubviews to manage previous/next according to UITextField's hierarchy in it's SuperView. Set it to IQAutoToolbarByTag to manage previous/next according to UITextField's tag property in increasing order. Default is IQAutoToolbarBySubviews. -
-resignFirstResponderResigns currently first responder field.
Feature:-
-
Support Device Orientation.
-
Enable/Disable Keyboard Manager when needed with
enableboolean. -
Easiest integration.
-
AutoHandle UIToolbar as a accessoryInputView of textField/textView with
enableAutoToolbarboolean. -
AutoHandle UIToolbar can be manged by superview's hierarchy or can be managed by tag property of textField/textView using
toolbarManageBehaviourenum. -
UIViewCategory for easily adding Next/Previous and Done button as Keyboard UIToolBar, even automatic withenableAutoToolbarboolean. -
Enable/Disable Next/Previous buttons with Category methods, even automatic with
enableAutoToolbarboolean. -
Set keyboard distance from textFields using
keyboardDistanceFromTextField. -
Resign keyboard on touching outside using
shouldResignOnTouchOutside. -
Manage UITextView's frame when it's hight is too large to fit on screen with
canAdjustTextViewboolean. -
Can manage
UITextField/UITextViewinsideUITableView/UIScrollView. -
Can play input sound on Next/Previous/Done click.
LICENSE
Distributed under the MIT License.
Contributions
Any contribution is more than welcome! You can contribute through pull requests and issues on GitHub.
Author
If you wish to contact me, email at: hack.iftekhar@gmail.com

