EKKeyboardAvoiding 2.0

EKKeyboardAvoiding 2.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Evgeniy Kirpichenko.



  • By
  • Evgeniy Kirpichenko

It's an universal solution for keyboard avoiding that automatically changes content inset of your UIScrollView classes. When keyboard appears you will be able to see all content of your scroll views.

How to install

Install using CocoaPods.

pod 'EKKeyboardAvoiding'

Usage

First import UIScrollView+EKKeyboardAvoiding category to your project

@import UIScrollView+EKKeyboardAvoiding

To enable keyboard avoiding you have to set contentSize of your scroll view and enable keyboard avoiding using category method setKeyboardAvoidingEnabled:

UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:[[self view] bounds]];
[scrollView setContentSize:[scrollView frame].size];
...
[scrollView setKeyboardAvoidingEnabled:YES];

To disable keyboard avoiding provide NO to setKeyboardAvoidingEnabled: method

Example

screenshot#1screenshot#2

Notes

Works on iPhone/iPad iOS 5.0+