Elevate Your Tab and Sidebar Experience in iPadOS - WWDC24

Peter Yaacoub •


Introduction

The new tab and sidebar experience in iPadOS has been expanded to all Apple platforms, including iOS, visionOS, macOS, and tvOS. This session covers the enhancements and adjustments to the tab bar and sidebar, making them more intuitive and versatile across different devices. Let’s explore these updates and how you can implement them in your apps.

Changes Across Platforms

Unified Tab Bar Experience

The new tab bar experience is now consistent across all Apple platforms:

  • iOS: Traditional bottom tab bar.
  • iPadOS: Centered on the top navigation bar, enhancing visibility.
  • macOS, visionOS, tvOS: Adaptive to different screen sizes and orientations.

No code changes are required for this visual shift, maintaining a seamless transition across devices.

Tab Bar Structure

  • Fixed Items: Always visible tabs.
  • Customizable Items: User-configurable tabs.
  • Pinned Items: Always accessible, even when scrolling.

SwiftUI Enhancements

SwiftUI introduces several new features for handling tabs and sidebars seamlessly:

Using TabView and TabViewStyle

  • Syntax: Use TabView with TabViewStyle to create tabs.
  • Special Roles: Utilize tabs with special roles, like searchTab.

Customization

Use tabViewCustomization(_:), customizationIdentifier, defaultVisibility(_:for:), and customizationBehavior(_:for:) for full customization.

UIKit Integration

Setting Up Tabs

In UIKit, creating and customizing tabs is straightforward:

Additional Properties

Conclusion

The enhancements to the tab and sidebar experience in iPadOS and across all Apple platforms bring a new level of flexibility and functionality to app development. Whether using SwiftUI or UIKit, these updates streamline the creation of intuitive and user-friendly interfaces.