Skip to main content

Overview

IQKeyboardManager includes built-in debug logging to help you understand what’s happening behind the scenes and troubleshoot issues. This guide covers enabling debug logs, common issues, and how to resolve them.

Enable Debug Logging

Enable debug logging in your AppDelegate to see detailed information about keyboard events:
AppDelegate.swift
Debug logging should only be enabled during development. Disable it in production builds to avoid performance impact and log clutter.

Debug Log Output

When enabled, you’ll see detailed logs in the Xcode console:
Console Output

Log Structure

Logs use indentation to show nested operations:

Enable Toolbar Debugging

Enable separate debugging for toolbar operations:
AppDelegate.swift
You’ll see toolbar-specific logs:
Console Output

Conditional Debugging

Enable debugging only in debug builds:
AppDelegate.swift

Common Issues and Solutions

Keyboard Not Adjusting

Symptom: Keyboard covers text fieldsSolution:
Debug Check: Enable logging and look for “Enabled” message at app launch.
Symptom: Works in some view controllers but not othersSolution: Check if the view controller is in the disabled list:
Debug Check: Look for logs showing the view controller being skipped.
Symptom: Specific text field not adjustingSolution:
Debug Check: Add a breakpoint and check the field’s enableMode property.
Symptom: Text fields in custom containers not detectedSolution:

Toolbar Not Appearing

Solution:
Solution:
Symptom: You’ve set a custom inputAccessoryViewExplanation: Custom input accessory views override the automatic toolbar.Solution: Remove custom inputAccessoryView or integrate it with IQKeyboardToolbarManager.

Tap-to-Dismiss Not Working

Solution:
Solution:
Solution:

Performance Issues

Cause: Complex view hierarchy or Auto Layout constraintsSolution:
Cause: Debug logging enabled in release buildsSolution:

Manual Management Tweaks

For cases where automatic behavior doesn’t work, you can manually control IQKeyboardManager:

Temporarily Disable

ViewController.swift

Manual Position Adjustment

ViewController.swift

Custom Distance Calculation

ViewController.swift

Known Issues

For a comprehensive list of known issues and workarounds, see:
The library documentation includes detailed information about edge cases and platform-specific issues.

Common Warnings

You may see these warnings in the console:

Negative Distance Warning

Solution: Ensure keyboardDistance is >= 0

Refuses to Resign Warning

Cause: The text field’s delegate returned false from textFieldShouldEndEditing(_:) Solution: Check your delegate implementation:

Debugging Checklist

When troubleshooting, go through this checklist:
1

Enable debug logging

2

Check if IQKeyboardManager is enabled

Look for “Enabled” message in console
3

Verify view controller not in disabled list

4

Check text field enable mode

5

Review console logs for errors

Look for warnings or error messages
6

Test with minimal configuration

Temporarily remove custom configuration to isolate the issue
7

Check for gesture conflicts

Disable custom gestures temporarily

Getting Help

If you’re still experiencing issues:
  1. Check the GitHub Issues: IQKeyboardManager Issues
  2. Review the Wiki: IQKeyboardManager Wiki
  3. Create a minimal reproducible example
  4. Include debug logs when reporting issues
  5. Specify your environment:
    • iOS version
    • Xcode version
    • IQKeyboardManager version
    • Swift version

Debug Configuration Example

Here’s a complete debug configuration:
AppDelegate.swift

Best Practices

Turn on debug logging when you first integrate IQKeyboardManager to understand its behavior.
Always disable debug logging in production builds using #if DEBUG conditionals.
Start with minimal configuration and only add customization as needed.
Add comments explaining why you’ve disabled or configured specific settings.
Test your forms on different devices, orientations, and iOS versions.

Next Steps

Basic Setup

Get started with IQKeyboardManager

Advanced Configuration

Fine-tune keyboard behavior

API Reference

Complete API documentation

GitHub Issues

Report issues or search for solutions