CocoaPods trunk is moving to be read-only. Read more on the blog, there are 16 months to go.

SMTKeyboardManager 1.1.0

SMTKeyboardManager 1.1.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Apr 2016

Maintained by “Steffi”.



  • By
  • Steffi

SMTkeyboardManager handles automatic scrolling of textfields that hides beneath the keyboard

Version

1.1.0

Changelog v1.1.0

  • Added UITextView support.
  • Updated scrolling calculations that will work for both UITextField and UITextView

Integration

Set all texfields to a subclass of

SMTTextFieldHandler

Set all TextView to a subclass of

SMTTextViewHandler
Keyboard Monitoring

Inside AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

SMTKeyboardManager * keyboardManager = [SMTKeyboardManager sharedManager];
[keyboardManager startKeyboardMonitoring];
return YES;
}
Delegate Methods
#pragma mark - SMTKeyboardManagerDelegate
#pragma mark -
-(void)SMTKeyboardManagerKeyboardWillShow{
NSLog(@"Hi I was called in delegate controller. Keyboard will show");
}
-(void)SMTKeyboardManagerKeyboardWillHide{
NSLog(@"Hi I was called in delegate controller. Keyboard will hide");
}
Properties
//Set YES to allow tap outside to dismiss keyboard
BOOL supportDismissTap

IMPORTANT

Pre-requisite:

  • Textfields/TextView must be inside a scrollview.
  • View hierarchy should be Controller View -> ScrollView -> TextField

Lets build together!

Fork, implement, pull request.

Copyright

Copyright (c) 2015 Steffi Tan
See MIT-LICENSE for further details.