wie kann ich die suche in der toolbar benutzen oder tab

Asked on 06/11/2025

1 search

To use the search functionality in the toolbar or tab, you can follow these guidelines from the WWDC sessions:

  1. UIKit Apps: In a UIKit app, you can place the search bar at the trailing edge of the navigation bar, which is ideal for split views. To enable this behavior, set the search bar placement to allow external integration on the navigation item. For a dedicated search view, consider including search as a section in the sidebar or tab bar. You can also use a UI Tab Bar controller to include a distinct tab for search. When tapped, the search button expands into a search field, and the other buttons collapse. To have the search field activate automatically when the search tab is tapped, set "automatically activate Search" to true on that tab. Build a UIKit app with the new design.

  2. SwiftUI Apps: In SwiftUI, you can use the searchable modifier on a NavigationSplitView to apply search functionality to the entire view. On iPhone, the search field automatically adapts to appear at the bottom of the display. For multi-tab apps, you can set a search role on one of your tabs and place a searchable modifier on your tab view. When someone selects this tab, a search field takes the place of the tab bar, and the content of the tab is shown. Build a SwiftUI app with the new design.

These updates provide a consistent search experience across platforms, making it easier to integrate search functionality into your app's design.