Overview
Version 7.0 introduces a cleaner, more organized API structure with configuration objects and the .iq wrapper pattern for UIView extensions. This improves code clarity and reduces namespace pollution.
Key Change : Most UIView extension properties now use the .iq namespace wrapper pattern.
Breaking Changes
Removed Features
The following properties and methods have been removed:
// Removed in v7
IQKeyboardManager. shared . preventShowingBottomBlankSpace
IQKeyboardManager. shared . shouldFixInteractivePopGestureRecognizer
IQKeyboardManager. shared . canAdjustAdditionalSafeAreaInsets
// Removed registration methods
IQKeyboardManager. shared . registerTextFieldViewClass (_: didBeginEditingNotificationName:didEndEditingNotificationName: )
IQKeyboardManager. shared . unregisterTextFieldViewClass (_: didBeginEditingNotificationName:didEndEditingNotificationName: )
Removed UIViewController Property
// Removed IBOutlet
@IBOutlet var IQLayoutGuideConstraint: NSLayoutConstraint ?
IQKeyboardManager Configuration Changes
Property Renaming
Many properties have been renamed for consistency:
v6 Properties
v7 Properties
IQKeyboardManager. shared . shouldResignOnTouchOutside
IQKeyboardManager. shared . shouldPlayInputClicks
IQKeyboardManager. shared . toolbarManageBehaviour
IQKeyboardManager. shared . shouldToolbarUsesTextFieldTintColor
IQKeyboardManager. shared . overrideKeyboardAppearance
IQKeyboardManager. shared . keyboardAppearance
Toolbar-related properties are now consolidated into IQToolbarConfiguration:
v6 Toolbar Properties
v7 Toolbar Configuration
IQKeyboardManager. shared . toolbarManageBehaviour
IQKeyboardManager. shared . shouldToolbarUsesTextFieldTintColor
IQKeyboardManager. shared . toolbarTintColor
IQKeyboardManager. shared . toolbarBarTintColor
IQKeyboardManager. shared . previousNextDisplayMode
IQKeyboardManager. shared . toolbarPreviousBarButtonItemImage
IQKeyboardManager. shared . toolbarPreviousBarButtonItemText
IQKeyboardManager. shared . toolbarPreviousBarButtonItemAccessibilityLabel
IQKeyboardManager. shared . toolbarNextBarButtonItemImage
IQKeyboardManager. shared . toolbarNextBarButtonItemText
IQKeyboardManager. shared . toolbarNextBarButtonItemAccessibilityLabel
IQKeyboardManager. shared . toolbarDoneBarButtonItemImage
IQKeyboardManager. shared . toolbarDoneBarButtonItemText
IQKeyboardManager. shared . toolbarDoneBarButtonItemAccessibilityLabel
Placeholder Configuration
Placeholder-related properties moved to IQToolbarPlaceholderConfiguration:
v6 Placeholder Properties
v7 Placeholder Configuration
IQKeyboardManager. shared . toolbarTitlBarButtonItemAccessibilityLabel
IQKeyboardManager. shared . shouldShowToolbarPlaceholder
IQKeyboardManager. shared . placeholderFont
IQKeyboardManager. shared . placeholderColor
IQKeyboardManager. shared . placeholderButtonColor
Keyboard Appearance Configuration
Keyboard appearance settings moved to IQKeyboardConfiguration:
v6 Keyboard Appearance
v7 Keyboard Configuration
IQKeyboardManager. shared . overrideKeyboardAppearance
IQKeyboardManager. shared . keyboardAppearance
Keyboard Listener Changes
Keyboard state monitoring has been moved to a dedicated IQKeyboardListener class:
v6 Keyboard Monitoring
v7 Keyboard Listener
IQKeyboardManager. shared . registerKeyboardSizeChange ( identifier : "myId" ) { size in
print ( "Keyboard size: \( size ) " )
}
IQKeyboardManager. shared . unregisterKeyboardSizeChange ( identifier : "myId" )
let isShowing = IQKeyboardManager. shared . keyboardShowing
let frame = IQKeyboardManager. shared . keyboardFrame
ScrollView extensions now use the .iq wrapper pattern:
v6 ScrollView Extensions
v7 ScrollView Extensions
scrollView. shouldIgnoreScrollingAdjustment = true
scrollView. shouldIgnoreContentInsetAdjustment = true
scrollView. shouldRestoreScrollViewContentOffset = true
UIView Extension Changes
Configuration Properties
v6 UIView Properties
v7 UIView Properties
textField. keyboardDistanceFromTextField = 10
textField. ignoreSwitchingByNextPrevious = true
textField. enableMode = . enabled
textField. shouldResignOnTouchOutsideMode = . enabled
View Hierarchy Methods
v6 View Hierarchy
v7 View Hierarchy
let controller = view. viewContainingController ()
let topController = view. topMostController ()
let container = view. parentContainerViewController ()
let superview = view. superviewOfClassType (UIScrollView. self )
v6 Toolbar Properties
v7 Toolbar Properties
textField. keyboardToolbar
textField. shouldHideToolbarPlaceholder = true
textField. toolbarPlaceholder = "Enter name"
textField. drawingToolbarPlaceholder
textField. addKeyboardToolbarWithTarget ( target : self ,
titleText : "Name" ,
rightBarButtonConfiguration : doneConfig)
UIViewController Extension Changes
v6 ViewController Method
v7 ViewController Method
open func parentIQContainerViewController () -> UIViewController ?
Migration Steps
Update Dependency
Update your Podfile or Package.swift to version 7.0+ # CocoaPods
pod 'IQKeyboardManagerSwift' , '~> 7.0'
// Swift Package Manager
. package ( url : "https://github.com/hackiftekhar/IQKeyboardManager.git" , from : "7.0.0" )
Install Dependencies
# CocoaPods
pod install
# Swift Package Manager
# File > Packages > Update to Latest Package Versions
Update Property Names
Use find-and-replace to update renamed properties:
shouldResignOnTouchOutside → resignOnTouchOutside
shouldPlayInputClicks → playInputClicks
overrideKeyboardAppearance → keyboardConfiguration.overrideAppearance
keyboardAppearance → keyboardConfiguration.appearance
Migrate Toolbar Configuration
Move toolbar settings to configuration objects: // Before
IQKeyboardManager. shared . toolbarTintColor = . blue
IQKeyboardManager. shared . shouldShowToolbarPlaceholder = true
// After
IQKeyboardManager. shared . toolbarConfiguration . tintColor = . blue
IQKeyboardManager. shared . toolbarConfiguration . placeholderConfiguration . showPlaceholder = true
Update UIView Extensions
Add .iq wrapper to all UIView extension properties: // Before
textField. keyboardDistanceFromTextField = 10
scrollView. shouldIgnoreScrollingAdjustment = true
// After
textField. iq . distanceFromKeyboard = 10
scrollView. iq . ignoreScrollingAdjustment = true
Update Keyboard Monitoring
If you use keyboard size monitoring, migrate to IQKeyboardListener: // Before
IQKeyboardManager. shared . registerKeyboardSizeChange ( identifier : "id" ) { size in }
// After
let listener = IQKeyboardListener ()
listener. registerSizeChange ( identifier : "id" ) { size in }
Build and Test
Build your project and fix compilation errors
Test all keyboard interactions
Verify toolbar customizations still work
Complete Example
Here’s a before/after comparison of typical AppDelegate configuration:
v6 Configuration
v7 Configuration
import IQKeyboardManagerSwift
func application ( _ application : UIApplication, didFinishLaunchingWithOptions launchOptions : [UIApplication.LaunchOptionsKey: Any ] ? ) -> Bool {
IQKeyboardManager. shared . enable = true
// Touch outside to dismiss
IQKeyboardManager. shared . shouldResignOnTouchOutside = true
// Toolbar configuration
IQKeyboardManager. shared . enableAutoToolbar = true
IQKeyboardManager. shared . toolbarTintColor = . systemBlue
IQKeyboardManager. shared . shouldShowToolbarPlaceholder = true
IQKeyboardManager. shared . placeholderFont = . systemFont ( ofSize : 14 )
IQKeyboardManager. shared . toolbarDoneBarButtonItemText = "Done"
// Keyboard appearance
IQKeyboardManager. shared . overrideKeyboardAppearance = true
IQKeyboardManager. shared . keyboardAppearance = . dark
return true
}
Benefits of v7 Architecture
Cleaner Namespace The .iq wrapper prevents pollution of UIView’s namespace
Organized Configuration Related settings grouped into configuration objects
Better Discoverability Xcode autocomplete shows related options together
Future-Proof Easier to add new features without API conflicts
Troubleshooting
Property not found on UITextField
Cause : Forgot to add .iq wrapperSolution :// Wrong
textField. distanceFromKeyboard = 10
// Correct
textField. iq . distanceFromKeyboard = 10
Cannot find 'toolbarTintColor' in scope
Keyboard monitoring not working
Cause : Need to use IQKeyboardListener insteadSolution :let listener = IQKeyboardListener ()
listener. registerSizeChange ( identifier : "myId" ) { size in
// Handle keyboard size change
}
Need Help?
If you encounter issues:
Search GitHub Issues
Check the v7 release notes
Ask questions in Discussions