TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | BSD |
ReleasedLast Release | Aug 2015 |
Maintained by Ian Leitch.
#import "TTKeyboardphobia.h"
- (void)viewDidLoad {
[super viewDidLoad];
self.keyboardphobia = [[TTKeyboardphobia alloc] init];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.keyboardphobia registerView:self.textView inScrollView:self.scrollView];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[self.keyboardphobia unregisterViews];
# Or, to unregister just a single view:
# [self.keyboardphobia unregisterView:self.textView];
}
You can also nest your input views inside a container view, TTKeyboardphobia will then align the frame of the container view with the top edge of the keyboard. Simply register your container instead of the input view directly:
[self.keyboardphobia registerView:self.textViewContainer inScrollView:self.scrollView];
TTKeyboardphobia will search the view hierarchy for the first responder, so you can nest your input in multiple container views if you wish.
TTKeyboardphobia is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "TTKeyboardphobia"
Ian Leitch, [email protected]
TTKeyboardphobia is available under the BSD license. See the LICENSE file for more info.