Installation Methods
- Swift Package Manager
- CocoaPods
- Carthage
Swift Package Manager is the recommended method for installing IQKeyboardManager.
Step 1: Add Package Dependency
In Xcode, add the package:- Go to File → Swift Packages → Add Package Dependency…
- Enter the repository URL:
- Choose the version you want (latest is recommended)
- 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)
Swift Version Compatibility
Make sure to install the correct version based on your Swift and Xcode versions:| Swift Version | Xcode Version | IQKeyboardManagerSwift Version |
|---|---|---|
| 5.9, 5.8, 5.7 | Xcode 16 | >= 7.0.0 |
| 5.9, 5.8, 5.7, 5.6 | Xcode 15 | >= 7.0.0 |
| 5.5, 5.4, 5.3, 5.2, 5.1, 5.0, 4.2 | Xcode 11 | >= 6.5.7 |
| 5.1, 5.0, 4.2, 4.0, 3.2, 3.0 | Xcode 11 | >= 6.5.0 |
| 5.0, 4.2, 4.0, 3.2, 3.0 | Xcode 10.2 | >= 6.2.1 |
| 4.2, 4.0, 3.2, 3.0 | Xcode 10.0 | >= 6.0.4 |
| 4.0, 3.2, 3.0 | Xcode 9.0 | 5.0.0 |
Source Code Installation
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 yourAppDelegate.swift, add the import statement:
Step 2: Check for Errors
Build your project (⌘+B) and ensure there are no import errors.Step 3: Test Basic Functionality
Add this code to verify the singleton is accessible:Troubleshooting
Module 'IQKeyboardManagerSwift' not found
Module 'IQKeyboardManagerSwift' not found
This usually means the framework wasn’t properly linked. Try:For SPM:
- Clean build folder: Product → Clean Build Folder (⌘+Shift+K)
- Delete derived data:
~/Library/Developer/Xcode/DerivedData - Close and reopen Xcode
- Rebuild the project
- File → Swift Packages → Reset Package Caches
- File → Swift Packages → Resolve Package Versions
Build errors after installation
Build errors after installation
If you see build errors after installing:
- Ensure your deployment target is iOS 13.0 or later
- Check that you’re using a compatible Xcode version (13+)
- Verify your Swift version matches the compatibility table
- Make sure you’re not mixing Swift and Objective-C versions
Carthage build fails
Carthage build fails
If Carthage fails to build:
CocoaPods integration issues
CocoaPods integration issues
If CocoaPods shows warnings or errors:
Xcode 15+ Code Signing Issues
Xcode 15+ Code Signing Issues
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.