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:
    https://github.com/hackiftekhar/IQKeyboardManager.git
    
  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:
Swift VersionXcode VersionIQKeyboardManagerSwift Version
5.9, 5.8, 5.7Xcode 16>= 7.0.0
5.9, 5.8, 5.7, 5.6Xcode 15>= 7.0.0
5.5, 5.4, 5.3, 5.2, 5.1, 5.0, 4.2Xcode 11>= 6.5.7
5.1, 5.0, 4.2, 4.0, 3.2, 3.0Xcode 11>= 6.5.0
5.0, 4.2, 4.0, 3.2, 3.0Xcode 10.2>= 6.2.1
4.2, 4.0, 3.2, 3.0Xcode 10.0>= 6.0.4
4.0, 3.2, 3.0Xcode 9.05.0.0

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:
import IQKeyboardManagerSwift

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:
func application(_ application: UIApplication, 
                 didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    
    print("IQKeyboardManager available: \(IQKeyboardManager.shared)")
    return true
}
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:
pod deintegrate
pod install
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:
# Try using xcframeworks
carthage update --use-xcframeworks --platform iOS

# Or specify the new build system
carthage update --use-xcframeworks --platform iOS --no-use-binaries
If CocoaPods shows warnings or errors:
# Update CocoaPods
sudo gem install cocoapods

# Update repository
pod repo update

# Clear cache and reinstall
pod cache clean --all
pod deintegrate
pod install
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:
post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_USER_SCRIPT_SANDBOXING'] = 'NO'
    end
  end
end

Next Steps

Quick Start

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

Build docs developers (and LLMs) love