No Description

Iftekhar 7399efb730 - Fixed some backward Xcode compatibility related problems 2 years ago
.github 0cb246d2cb Update issue templates 7 years ago
Demo 7399efb730 - Fixed some backward Xcode compatibility related problems 2 years ago
Demo.xcodeproj 7399efb730 - Fixed some backward Xcode compatibility related problems 2 years ago
Demo.xcworkspace f6ff5abdb7 - Upgraded to Xcode 9.3 7 years ago
DemoExtension 745e70bb4d Fixed #1908 2 years ago
DemoObjCUITests ec11dca0f1 Removed deprecated properties 6 years ago
IQKeyboardManager 7399efb730 - Fixed some backward Xcode compatibility related problems 2 years ago
IQKeyboardManager.xcodeproj 3bedcf8e6f - Replaced +Initialize method with -initialized which will be a non-proxy function Fixed #1905 2 years ago
IQKeyboardManagerSwift 7399efb730 - Fixed some backward Xcode compatibility related problems 2 years ago
Screenshot e5d4653f82 Add files via upload 7 years ago
.codeclimate.yml f91093057e Create .codeclimate.yml 9 years ago
.coveralls.yml d834d7bb33 Create .coveralls.yml 10 years ago
.gitattributes 0405da3cf8 Added gitattributes 3 years ago
.gitignore 012ef1dd3c - Added couple of compile time validations for Xcode 11, iOS 13 6 years ago
.swiftlint.yml 4da83f51df - Added SwiftLint in demo project to fix coding style. 5 years ago
.travis.yml c7d5a3609d - Fixed #1604 5 years ago
CODE_OF_CONDUCT.md e9f9bd785d Create CODE_OF_CONDUCT.md 7 years ago
CONTRIBUTING.md 8b41f6a44d Create CONTRIBUTING.md 7 years ago
DemoSwift.entitlements 3f88bfc6d1 Fixed #1824 by adding availability attributes 3 years ago
IQKeyboardManager.podspec.json 9ab144a1a6 Fixed a compilation issue 3 years ago
IQKeyboardManagerSwift.podspec.json 9ab144a1a6 Fixed a compilation issue 3 years ago
ISSUE_TEMPLATE.md 0c572913ad Update ISSUE_TEMPLATE.md 7 years ago
LICENSE.md 910d023966 Reformat LICENSE, bump copyright year 7 years ago
PULL_REQUEST_TEMPLATE.md 137cb8042b Create PULL_REQUEST_TEMPLATE.md 7 years ago
Package.swift 9ab144a1a6 Fixed a compilation issue 3 years ago
Podfile 474f849acc Added an App Extension to test library against it. Fixed the compiltion issues 3 years ago
Podfile.lock 474f849acc Added an App Extension to test library against it. Fixed the compiltion issues 3 years ago
README.md eb29689466 adds spm install guides, sign the commit 5 years ago

README.md

Icon

IQKeyboardManager

GitHub license

Build Status

While developing iOS apps, we often run into issues where the iPhone keyboard slides up and covers the UITextField/UITextView. IQKeyboardManager allows you to prevent this issue of keyboard sliding up and covering UITextField/UITextView without needing you to write any code or make any additional setup. To use IQKeyboardManager you simply need to add source files to your project.

Key Features

1) **CODELESS**, Zero Lines of Code

2) Works Automatically

3) No More UIScrollView

4) No More Subclasses

5) No More Manual Work

6) No More #imports

IQKeyboardManager works on all orientations, and with the toolbar. It also has nice optional features allowing you to customize the distance from the text field, behaviour of previous, next and done buttons in the keyboard toolbar, play sound when the user navigates through the form and more.

Screenshot

IQKeyboardManager Settings

GIF animation

IQKeyboardManager

Video

IQKeyboardManager Demo Video

Tutorial video by @rebeloper (#1135)

@rebeloper demonstrated two videos on how to implement IQKeyboardManager at it's core:

Youtube Tutorial Playlist

https://www.youtube.com/playlist?list=PL_csAAO9PQ8aTL87XnueOXi3RpWE2m_8v

Warning

  • If you're planning to build SDK/library/framework and want to handle UITextField/UITextView with IQKeyboardManager then you're totally going the wrong way. I would never suggest to add IQKeyboardManager as dependency/adding/shipping with any third-party library. Instead of adding IQKeyboardManager you should implement your own solution to achieve same kind of results. IQKeyboardManager is totally designed for projects to help developers for their convenience, it's not designed for adding/dependency/shipping with any third-party library, because doing this could block adoption by other developers for their projects as well (who are not using IQKeyboardManager and have implemented their custom solution to handle UITextField/UITextView in the project).
  • If IQKeyboardManager conflicts with other third-party library, then it's developer responsibility to enable/disable IQKeyboardManager when presenting/dismissing third-party library UI. Third-party libraries are not responsible to handle IQKeyboardManager.

Requirements

[Platform iOS]()

Language Minimum iOS Target Minimum Xcode Version
IQKeyboardManager Obj-C iOS 8.0 Xcode 9
IQKeyboardManagerSwift Swift iOS 8.0 Xcode 9
Demo Project Xcode 11

Swift versions support

Swift Xcode IQKeyboardManagerSwift
5.1, 5.0, 4.2, 4.0, 3.2, 3.0 11 >= 6.5.0
5.0,4.2, 4.0, 3.2, 3.0 10.2 >= 6.2.1
4.2, 4.0, 3.2, 3.0 10.0 >= 6.0.4
4.0, 3.2, 3.0 9.0 5.0.0

Installation

Installation with CocoaPods

CocoaPods

IQKeyboardManager (Objective-C): IQKeyboardManager is available through CocoaPods. To install it, simply add the following line to your Podfile: (#9)

pod 'IQKeyboardManager' #iOS8 and later

IQKeyboardManager (Swift): IQKeyboardManagerSwift is available through CocoaPods. To install it, simply add the following line to your Podfile: (#236)

Swift 5.1, 5.0, 4.2, 4.0, 3.2, 3.0 (Xcode 11)

pod 'IQKeyboardManagerSwift'

Or you can choose the version you need based on Swift support table from Requirements

pod 'IQKeyboardManagerSwift', '6.3.0'

In AppDelegate.swift, just import IQKeyboardManagerSwift framework and enable IQKeyboardManager.

import IQKeyboardManagerSwift

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

      IQKeyboardManager.shared.enable = true

      return true
    }
}

Installation with Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate IQKeyboardManger or IQKeyboardManagerSwift into your Xcode project using Carthage, add the following line to your Cartfile:

github "hackiftekhar/IQKeyboardManager"

Run carthage to build the frameworks and drag the appropriate framework (IQKeyboardManager.framework or IQKeyboardManagerSwift.framework) into your Xcode project based on your need. Make sure to add only one framework and not both.

Installation with Source Code

[Github tag]()

IQKeyboardManager (Objective-C): Just drag and drop IQKeyboardManager directory from demo project to your project. That's it.

IQKeyboardManager (Swift): Drag and drop IQKeyboardManagerSwift directory from demo project to your project

In AppDelegate.swift, just enable IQKeyboardManager.

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

      IQKeyboardManager.shared.enable = true

      return true
    }
}

Installation with Swift Package Manager

Swift Package Manager(SPM) is Apple's dependency manager tool. It is now supported in Xcode 11. So it can be used in all appleOS types of projects. It can be used alongside other tools like CocoaPods and Carthage as well.

To install IQKeyboardManager package into your packages, add a reference to IQKeyboardManager and a targeting release version in the dependencies section in Package.swift file:

import PackageDescription

let package = Package(
    name: "YOUR_PROJECT_NAME",
    products: [],
    dependencies: [
        .package(url: "https://github.com/hackiftekhar/IQKeyboardManager.git", from: "6.5.0")
    ]
)

To install IQKeyboardManager package via Xcode

Migration Guide

Other Links

Flow Diagram

IQKeyboardManager CFD

If you would like to see detailed Flow diagram then check Detailed Flow Diagram.

LICENSE

Distributed under the MIT License.

Contributions

Any contribution is more than welcome! You can contribute through pull requests and issues on GitHub.

Author

If you wish to contact me, email at: hack.iftekhar@gmail.com