Skip to main content

Overview

The IQKeyboardToolbarManager subspec provides an automatic toolbar above the keyboard with Previous/Next/Done buttons, allowing users to navigate between text fields without dismissing the keyboard.
As of version 7.0+, IQKeyboardToolbarManager is now available as an independent library. The integration with IQKeyboardManager is deprecated but still functional.

Installation

CocoaPods

Podfile

Swift Package Manager

Add the IQKeyboardToolbarManager package separately:

Basic Setup

1

Import the library

AppDelegate.swift
2

Enable auto toolbar

AppDelegate.swift
3

Test the toolbar

Run your app and tap on a text field. You should see a toolbar with Previous/Next/Done buttons above the keyboard.
The toolbar integration via IQKeyboardManager.shared.enableAutoToolbar is deprecated. Consider using IQKeyboardToolbarManager independently for new projects.

Toolbar Configuration

Access toolbar configuration through the toolbarConfiguration property:
AppDelegate.swift

Programmatic Navigation

Navigate between text fields programmatically:
ViewController.swift

Check Navigation Availability

ViewController.swift

Class-Level Control

Disable Toolbar for Specific View Controllers

AppDelegate.swift

Force Enable for Specific Classes

AppDelegate.swift
If a class appears in both disabledToolbarClasses and enabledToolbarClasses, the disabled list takes precedence.

Sound Effects

Enable input click sounds when toolbar buttons are tapped:
AppDelegate.swift

Deep Responder Navigation

Allow navigation between text fields in different container views:
AppDelegate.swift
This is useful when you have text fields organized in stack views, scroll views, or custom container views.

Toolbar Debugging

Enable debug logging for toolbar operations:
AppDelegate.swift

Example: Custom Form with Toolbar

FormViewController.swift

Toolbar Behavior

The toolbar automatically:
  1. Shows Previous button when there’s a previous text field
  2. Shows Next button when there’s a next text field
  3. Disables buttons when navigation is not possible
  4. Shows Done button to dismiss the keyboard
  5. Updates state when text fields change

Customizing Button Behavior

While the toolbar is automatic, you can customize button actions by:
  1. Using the standalone IQKeyboardToolbarManager library
  2. Implementing custom toolbar with inputAccessoryView
  3. Handling return key navigation (see Return Key Handling)

Toolbar vs Return Key Navigation

Toolbar Navigation

  • Visible Previous/Next/Done buttons
  • User taps buttons to navigate
  • Keyboard stays visible
  • Better for long forms

Return Key Navigation

  • Uses Return key to advance
  • More natural typing flow
  • Automatically changes return key type
  • Better for short forms
You can enable both toolbar and return key navigation for maximum flexibility.

Troubleshooting

  • Verify enableAutoToolbar is set to true
  • Check if the view controller is in disabledToolbarClasses
  • Ensure you’re using UITextField or UITextView
  • Enable toolbar debugging: IQKeyboardManager.shared.enableToolbarDebugging = true
  • Use reloadInputViews() after dynamically adding/removing text fields
  • Check deepResponderAllowedContainerClasses if fields are in custom containers
  • Verify text fields are in the view hierarchy when keyboard appears
  • Configure toolbarConfiguration in AppDelegate
  • Check for conflicts with custom inputAccessoryView
  • Verify tint colors are visible against toolbar background

Migration to Standalone Library

If you’re migrating to the standalone IQKeyboardToolbarManager:
AppDelegate.swift

Next Steps

Return Key Handling

Navigate using the Return key

Appearance Customization

Customize keyboard appearance

Advanced Configuration

Fine-tune keyboard behavior

Debugging

Troubleshoot toolbar issues