EKKeyboardAvoiding

master

It's an universal solution for keyboard avoiding for iOS that allows automatically change content inset of UIScrollView and it's subclasses. When keyboard is presented you will be able to see all content of your scroll views.
monzo/EKKeyboardAvoiding

EKKeyboardAvoiding 2.1

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'

Install using SPM

To integrate EKKeyboardAvoiding into your Xcode project using Swift Package Manager, add it to the dependencies value of your Package.swift:

dependencies: [
    .package(url: "https://github.com/monzo/EKKeyboardAvoiding.git", .upToNextMajor(from: "2.1.0"))
]

Usage

First import UIScrollView+EKKeyboardAvoiding category to your project

#import "UIScrollView+EKKeyboardAvoiding.h"

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+

Bitdeli Badge

Description

  • Swift Tools 5.3.0
View More Packages from this Author

Dependencies

  • None
Last updated: Fri May 16 2025 22:13:24 GMT-0900 (Hawaii-Aleutian Daylight Time)