Skip to content

Compatibility issue with navigationItem.searchController on iOS 26 #2151

@kiritokatklian

Description

@kiritokatklian

Describe the bug
When assigning a UISearchController to navigationItem.searchController, the search bar is displayed at the bottom of the view in iOS 26.0. When the search field becomes active, the keyboard pushes the entire view up instead of only adjusting for the search text field. (Conditionally) disabling IQKeyboardManager fixes the issue.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new view and set a distinct background color (e.g. blue)
  2. Embed the view in a navigation controller
  3. Assign an instance of UISearchController() to navigationItem.searchController
  4. Tap on the search text field

The entire view is pushed upward when the keyboard appears. The system background color becomes visible behind the keyboard, while the view's background (blue) is cut off above it.

Expected behavior
Only the search bar's text field should adjust for the keyboard, not the entire view. However, this behavior is consistent with how IQKeyboardManager handles layout adjustments, so it's technically correct.

Screenshots

Inactive Active
Image Image

Demo Project
N/A

Versions

Xcode: 26.0
Mac OS: 26.0
Simulator/Device: 26.0
Simulator/Device Name: iPhone 12
Library Version: 8.0.1

Additional context
While this might be the intended behavior of IQKeyboardManager, it can be confusing when using navigationItem.searchController on iOS 26.0.
If this isn't something that can be fixed within the library, I recommend pinning or documenting it to save others time finding the cause.

Workaround/fix
You can work around the issue by temporarily disabling IQKeyboardManager while the text field is active, or inside viewWillAppear/viewWillDisappear on the view controller level:

extension MySearchController: UISearchBarDelegate {
	func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) {
		IQKeyboardManager.shared.isEnabled = false
	}

	func searchBarTextDidEndEditing(_ searchBar: UISearchBar) {
		IQKeyboardManager.shared.isEnabled = true
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions