Skip to main content
IQKeyboardManager can be installed using CocoaPods, Swift Package Manager (SPM), or Carthage. Choose the method that works best for your project.

Installation Methods

Swift Package Manager is the recommended method for installing IQKeyboardManager.

Step 1: Add Package Dependency

In Xcode, add the package:
  1. Go to File → Swift Packages → Add Package Dependency…
  2. Enter the repository URL:
  3. Choose the version you want (latest is recommended)
  4. Click Add Package

Step 2: Select Target

Select your app target and click Finish.
SPM automatically includes all subspecs and their dependencies.

Package Dependencies

IQKeyboardManager depends on several independent libraries:
  • IQKeyboardNotification (>= 1.0.6)
  • IQTextInputViewNotification (>= 1.0.9)
  • IQKeyboardToolbarManager (>= 1.1.4)
  • IQKeyboardReturnManager (>= 1.0.6)
  • IQTextView (>= 1.0.5)
These are automatically managed by SPM.

Swift Version Compatibility

Make sure to install the correct version based on your Swift and Xcode versions:

Source Code Installation

Source code installation is not supported since version 7.2.0.
The library now depends on several independent libraries, which makes source code installation complex and prone to compilation issues. Please use one of the package managers above.

Verification

After installation, verify that IQKeyboardManager is properly integrated:

Step 1: Import the Framework

In your AppDelegate.swift, add the import statement:

Step 2: Check for Errors

Build your project (⌘+B) and ensure there are no import errors.
If you see a “No such module” error, clean the build folder (⌘+Shift+K) and rebuild.

Step 3: Test Basic Functionality

Add this code to verify the singleton is accessible:
If this prints successfully, the installation is complete!

Troubleshooting

This usually means the framework wasn’t properly linked. Try:
  1. Clean build folder: Product → Clean Build Folder (⌘+Shift+K)
  2. Delete derived data: ~/Library/Developer/Xcode/DerivedData
  3. Close and reopen Xcode
  4. Rebuild the project
For CocoaPods:
For SPM:
  • File → Swift Packages → Reset Package Caches
  • File → Swift Packages → Resolve Package Versions
If you see build errors after installing:
  1. Ensure your deployment target is iOS 13.0 or later
  2. Check that you’re using a compatible Xcode version (13+)
  3. Verify your Swift version matches the compatibility table
  4. Make sure you’re not mixing Swift and Objective-C versions
If Carthage fails to build:
If CocoaPods shows warnings or errors:
If you encounter code signing issues in Xcode 15+:The library includes ENABLE_USER_SCRIPT_SANDBOXING = NO in its xcconfig to prevent build issues. If you still have problems, add this to your project’s build settings or Podfile:

Next Steps

Quick Start

Now that you’ve installed IQKeyboardManager, learn how to set it up and use it in your app.