explaingit

hackiftekhar/iqkeyboardmanager

16,624SwiftAudience · developerComplexity · 2/5Setup · easy

TLDR

A drop-in iOS library that automatically prevents the on-screen keyboard from covering text fields, no per-screen scroll code needed, just add it to your project and enable it once in AppDelegate.

Mindmap

mindmap
  root((IQKeyboardManager))
    What it does
      Auto-scrolls views
      Prevents overlap
      Drop-in setup
    Subspecs
      Keyboard toolbar
      Return key handler
      Tap to dismiss
    Compatibility
      UIScrollView
      UITableView
      UICollectionView
    Install
      CocoaPods
      Swift Package Manager
      Carthage
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Fix keyboard-overlap on every form screen in an iOS app without writing any per-screen scroll adjustment code.

USE CASE 2

Add a Previous, Next, and Done toolbar above the keyboard in a multi-field form to help users move between inputs.

USE CASE 3

Enable tap-anywhere-to-dismiss keyboard behavior across an entire iOS app with a single configuration call.

Tech stack

SwiftObjective-CCocoaPodsCarthageSwift Package Manager

Getting it running

Difficulty · easy Time to first run · 5min

Must not be bundled inside other libraries or SDKs, only use it directly in app targets.

License not mentioned in the explanation.

In plain English

IQKeyboardManager is a small iOS library that fixes one of the most common annoyances in mobile app development: when the on-screen keyboard pops up, it often slides up and covers the text field the user is trying to type in. Normally a developer has to write code that listens for the keyboard appearing, measures its height, and shifts the screen up so the active text field stays visible. This library handles all of that automatically, the README describes it as a codeless, drop-in solution, meaning you simply add it to your project and enable it once, and from then on every text field in the app behaves correctly. Internally it watches for the keyboard appearing and automatically scrolls or shifts the relevant view so the active UITextField or UITextView stays visible. It works with standard UIKit views and with scrolling containers like UIScrollView, UITableView, and UICollectionView. It supports all interface orientations, lets you configure the distance between the keyboard and the text field, and can be enabled or disabled per screen if it conflicts with a specific view. The library is organised into optional pieces (called subspecs) so you can include only the parts you need, for example a toolbar with Previous, Next, and Done buttons above the keyboard, return-key handling, tap-anywhere-to-dismiss-keyboard behaviour, keyboard appearance options, or a UITextView with placeholder support. Someone would use it on any iOS app that has forms or chat-style input and does not want to manually solve keyboard-overlap on every screen. The library is written in Swift, requires iOS 13 or newer and Xcode 13 or newer, and can be installed through CocoaPods, Carthage, or Swift Package Manager. The author warns it should not be bundled inside other libraries, only used directly in apps. An Objective-C version lives in a separate repository. The full README is longer than what was provided.

Copy-paste prompts

Prompt 1
Add IQKeyboardManager to my Swift iOS app via Swift Package Manager and enable it so no text fields are ever covered by the keyboard.
Prompt 2
Configure IQKeyboardManager to show Previous, Next, and Done toolbar buttons and set a 10pt gap between the keyboard and the active text field.
Prompt 3
Disable IQKeyboardManager on a specific view controller where its automatic scrolling conflicts with my custom scroll view.
Prompt 4
Set up the IQKeyboardManager UITextView subspec to add placeholder support to a UITextView inside a UITableView form.
Prompt 5
Why does IQKeyboardManager say it must not be bundled inside another library, and how do I handle it if I am building an SDK?
Open on GitHub → Explain another repo

← hackiftekhar on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.