From 5a08b738ea494d63a37e463b7f6a2b527a7c3639 Mon Sep 17 00:00:00 2001 From: hackiftekhar Date: Thu, 6 Mar 2014 19:22:02 +0530 Subject: [PATCH] Updated ReadMe --- .../IQKeyBoardManager/IQKeyboardManager.h | 2 +- README.md | 61 ++++++++----------- 2 files changed, 28 insertions(+), 35 deletions(-) diff --git a/KeyboardTextFieldDemo/IQKeyBoardManager/IQKeyboardManager.h b/KeyboardTextFieldDemo/IQKeyBoardManager/IQKeyboardManager.h index 5ba82f6d..9cadd3e0 100755 --- a/KeyboardTextFieldDemo/IQKeyBoardManager/IQKeyboardManager.h +++ b/KeyboardTextFieldDemo/IQKeyBoardManager/IQKeyboardManager.h @@ -73,7 +73,7 @@ @property(nonatomic, assign) BOOL canAdjustTextView; /*! - @property resignOnTouchOutside + @property shouldResignOnTouchOutside @abstract Resigns Keyboard on touching outside of UITextField/View. Default is NO. */ diff --git a/README.md b/README.md index 1ccaddac..ff893acf 100644 --- a/README.md +++ b/README.md @@ -25,55 +25,48 @@ it simply add the following line to your Podfile: Framework:- --- -Link your project against `KeyboardManager.framework` found in "KeyboardManagerFramework" directory. Drag and drop the resource bundle `IQKeyboardManager.bundle` found in same directory. add `-ObjC` flag in `other linker flag`. In your `appDelegate.m` import `#import `. Write just one line of code. +Link your project against `KeyboardManager.framework` found in "KeyboardManagerFramework" 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. In your `appDelegate.m` import `#import "IQKeyboardManager.h"`. Write just one line of 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. -## Usage -``` objc -//AppDelegate.m +Properties and functions usage:- +--- +1) @method +sharedManager; +Returns the default singleton instance. + +2) @property enable; +Use this to enable/disable managing distance between keyboard & textField/textView). -#import "AppDelegate.h" -#import "IQKeyboardManager.h" +3) @property keyboardDistanceFromTextField +Set Distance between keyboard & textField. Can't be less than zero. Default is 10. -@implementation AppDelegate +4) @property enableAutoToolbar +Enable autoToolbar behaviour. If It is set to NO. You have to manually create UIToolbar for keyboard. Default is YES. -- (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]; +5) @property canAdjustTextView +Giving permission to modify TextView's frame. Adjust textView's frame when it is too big in height. Default is NO. - //(Optional)Enable autoToolbar behaviour. If It is set to NO. You have to manually create UIToolbar for keyboard. - //[[IQKeyboardManager sharedManager] setEnableAutoToolbar:YES]; +6) @property shouldResignOnTouchOutside +Resign textField if touched outside of UITextField/UITextView. - //(Optional)Setting 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. - //[[IQKeyboardManager sharedManager] setToolbarManageBehaviour:IQAutoToolbarBySubviews]; +7) @property shouldShowTextFieldPlaceholder +If YES, then it add the textField's placeholder text on IQToolbar. Default is YES. - //(Optional)Resign textField if touched outside of UITextField/UITextView. - //[[IQKeyboardManager sharedManager] setShouldResignOnTouchOutside:YES]; - - //(Optional)Giving permission to modify TextView's frame - //[[IQKeyboardManager sharedManager] setCanAdjustTextView:YES]; +8) @property shouldPlayInputClicks +If YES, then it plays inputClick sound on next/previous/done click. Default is NO. - //(Optional)Show TextField placeholder texts on autoToolbar - //[[IQKeyboardManager sharedManager] setShouldShowTextFieldPlaceholder:YES]; +9) @property toolbarUsesCurrentWindowTintColor +If YES, then uses textField's tintColor property for IQToolbar, otherwise tintColor is black. Default is NO. - //Play system sounds on next/previous/done click. - //[[IQKeyboardManager sharedManager] setShouldPlayInputClicks:YES]; - - [self.window makeKeyAndVisible]; - return YES; -} +10) @property toolbarManageStyle +Setting 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. +11) @method -resignFirstResponder +Resigns currently first responder field. -``` If you don't want to import these files you can use an older version of `IQKeyboardManager` in Tag 2.6.