Skip to main content

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:
IQKeyboardManager.shared.shouldResignOnTouchOutside
IQKeyboardManager.shared.shouldPlayInputClicks
IQKeyboardManager.shared.toolbarManageBehaviour
IQKeyboardManager.shared.shouldToolbarUsesTextFieldTintColor
IQKeyboardManager.shared.overrideKeyboardAppearance
IQKeyboardManager.shared.keyboardAppearance

Toolbar Configuration

Toolbar-related properties are now consolidated into IQToolbarConfiguration:
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:
IQKeyboardManager.shared.toolbarTitlBarButtonItemAccessibilityLabel
IQKeyboardManager.shared.shouldShowToolbarPlaceholder
IQKeyboardManager.shared.placeholderFont
IQKeyboardManager.shared.placeholderColor
IQKeyboardManager.shared.placeholderButtonColor

Keyboard Appearance Configuration

Keyboard appearance settings moved to IQKeyboardConfiguration:
IQKeyboardManager.shared.overrideKeyboardAppearance
IQKeyboardManager.shared.keyboardAppearance

Keyboard Listener Changes

Keyboard state monitoring has been moved to a dedicated IQKeyboardListener class:
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

UIScrollView Extension Changes

ScrollView extensions now use the .iq wrapper pattern:
scrollView.shouldIgnoreScrollingAdjustment = true
scrollView.shouldIgnoreContentInsetAdjustment = true
scrollView.shouldRestoreScrollViewContentOffset = true

UIView Extension Changes

Configuration Properties

textField.keyboardDistanceFromTextField = 10
textField.ignoreSwitchingByNextPrevious = true
textField.enableMode = .enabled
textField.shouldResignOnTouchOutsideMode = .enabled

View Hierarchy Methods

let controller = view.viewContainingController()
let topController = view.topMostController()
let container = view.parentContainerViewController()
let superview = view.superviewOfClassType(UIScrollView.self)

Toolbar Properties

textField.keyboardToolbar
textField.shouldHideToolbarPlaceholder = true
textField.toolbarPlaceholder = "Enter name"
textField.drawingToolbarPlaceholder
textField.addKeyboardToolbarWithTarget(target: self, 
                                       titleText: "Name",
                                       rightBarButtonConfiguration: doneConfig)

UIViewController Extension Changes

open func parentIQContainerViewController() -> UIViewController?

Migration Steps

1

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")
2

Install Dependencies

# CocoaPods
pod install

# Swift Package Manager
# File > Packages > Update to Latest Package Versions
3

Update Property Names

Use find-and-replace to update renamed properties:
  • shouldResignOnTouchOutsideresignOnTouchOutside
  • shouldPlayInputClicksplayInputClicks
  • overrideKeyboardAppearancekeyboardConfiguration.overrideAppearance
  • keyboardAppearancekeyboardConfiguration.appearance
4

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
5

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
6

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 }
7

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

Cause: Forgot to add .iq wrapperSolution:
// Wrong
textField.distanceFromKeyboard = 10

// Correct
textField.iq.distanceFromKeyboard = 10
Cause: Property moved to configuration objectSolution:
// Wrong
IQKeyboardManager.shared.toolbarTintColor = .blue

// Correct
IQKeyboardManager.shared.toolbarConfiguration.tintColor = .blue
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:
  1. Search GitHub Issues
  2. Check the v7 release notes
  3. Ask questions in Discussions

Build docs developers (and LLMs) love