Often while developing an app, We ran into an issues where the iPhone UIKeyboard slide up and cover the UITextField/UITextView.
Just drag and drop IQKeyboardManager class in your project. In your appDelegate.m write just one line of code. This will handle all UITextField/UITextView covering problem.
//AppDelegate.m
#import "AppDelegate.h"
#import "IQKeyboardManager.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//ONE LINE OF CODE.
//Enabling keyboard manager(Use this line to enable managing distance between keyboard & textField/textView).
[[IQKeyboardManager sharedManager] setEnable:YES];
//(Optional)Set Distance between keyboard & textField, Default is 10.
//[[IQKeyboardManager sharedManager] setKeyboardDistanceFromTextField:15];
//(Optional)Enable autoToolbar behaviour. If It is set to NO. You have to manually create UIToolbar for keyboard.
//[[IQKeyboardManager sharedManager] setEnableAutoToolbar:YES];
//(Optional)Setting toolbar behaviour to IQAutoToolbarBySubviews to manage previous/next according to UITextField's hirarchy in it's SuperView. Set it to IQAutoToolbarByTag to manage previous/next according to UITextField's tag property in increasing order.
//[[IQKeyboardManager sharedManager] setToolbarManageBehaviour:IQAutoToolbarBySubviews];
[self.window makeKeyAndVisible];
return YES;
}
-
Support Device Orientation.
-
Easy integration.
-
UITextField Category for easily adding Next/Previous and Done button as Keyboard UIToolBar.
-
Enable/Desable Keyboard Manager when needed.
-
Enable/Desable Next/Previous with Category methods.
-
Set keyboard distance from textFields.
-
AutoHandle UIToolbar as a accessoryInputView of textField/textView.
-
AutoHandle UIToolbar can be manged by superview's hierarchy or can be managed by tag property of textField/textView.
-
Autohandle in Whole application without any extra work or code.
This project is *100% free* because it is under MIT license. However, developing and supporting this control is hard work and costs time and real money. Please help support the development of this project!