How do I set accessory for tabview
Asked on 06/12/2025
1 search
To set an accessory for a UITabBarController
in a UIKit app, you can follow these steps:
-
Create a
UITabAccessory
: First, create aUITabAccessory
with your content view. This accessory will be used to display additional content above the tab bar. -
Set the Bottom Accessory Property: Assign the created
UITabAccessory
to thebottomAccessory
property of yourUITabBarController
. This will position the accessory view above the tab bar. -
Handle Space Constraints: When the accessory is in line with the tab bar, there might be less space available to display it. You can manage this by adjusting the content of your accessory view to accommodate the reduced space.
-
Observe Changes: Register to observe changes to the Tab Accessory Environment Trait. This allows you to check if the accessory view is in line with the tab bar and update the view if needed.
-
Automatic Trait Tracking: Utilize the new Update Properties method to update your accessory view with automatic trait tracking behavior.
For more detailed information, you can refer to the session Build a UIKit app with the new design (00:03:08) from WWDC 2025.

Build a UIKit app with the new design
Update your UIKit app to take full advantage of the new design system. We’ll dive into key changes to tab views, split views, bars, presentations, search, and controls, and show you how to use Liquid Glass in your custom UI. To get the most out of this video, we recommend first watching “Get to know the new design system” for general design guidance.

Build a SwiftUI app with the new design
Explore the ways Liquid Glass transforms the look and feel of your app. Discover how this stunning new material enhances toolbars, controls, and app structures across platforms, providing delightful interactions and seamlessly integrating your app with the system. Learn how to adopt new APIs that can help you make the most of Liquid Glass.

Evolve your document launch experience
Make your document-based app stand out, and bring its unique identity into focus with the new document launch experience. Learn how to leverage the new API to customize the first screen people see when they launch your app. Utilize the new system-provided design, and amend it with custom actions, delightful decorative views, and impressive animations.