Skip to content
This repository was archived by the owner on Dec 11, 2025. It is now read-only.

v59.1.0

Choose a tag to compare

@jverkoey jverkoey released this 01 Aug 20:29
· 4720 commits to stable since this release

AppBar and FlexibleHeader shipped several new features in this release. This release also includes additional accessibility improvements and examples, and also fixes some bugs.

New features

The new MDCAppBarNavigationController class is a simpler integration strategy for adding an App Bar to an application. Example:

let navigationController = MDCAppBarNavigationController()

// Will automatically inject an AppBar into the view controller if one is not already present.
navigationController.pushViewController(viewController, animated: true)

This new API enables all of the new AppBar and FlexibleHeader behaviors, meaning view controllers will better handle being presented in non-full screen settings. If you have already integrated with App Bar, migrating to MDCAppBarNavigationController will allow you to delete a substantial amount of boilerplate from your application. Most notably, MDCAppBarNavigationController enables the new observesTrackingScrollViewScrollEvents feature on FlexibleHeader, meaning you do not need to forward scroll view events to the navigation controller.

At a minimum you will need to implement the MDCAppBarNavigationController's delegate to theme the injected App Bars. Implement the delegate like so:

navigationController.delegate = self

// MARK: MDCAppBarNavigationControllerInjectorDelegate

func appBarNavigationController(_ navigationController: MDCAppBarNavigationController,
                                willAdd appBar: MDCAppBar,
                                asChildOf viewController: UIViewController) {
  let colorScheme: MDCSemanticColorScheme = <# Fetch your color scheme #>
  let typographyScheme: MDCTypographyScheme = <# Fetch your typography scheme #>
  MDCAppBarColorThemer.applySemanticColorScheme(colorScheme, to: appBar)
  MDCAppBarTypographyThemer.applyTypographyScheme(typographyScheme, to: appBar)
                                                  
  // Additional configuration of appBar if needed.
}

AppBar's new inferTopSafeAreaInsetFromViewController property enables App Bars to be presented in non-full-screen contexts, such as iPad popovers or extensions. Consider enabling this property by default in all use cases.

FlexibleHeader's new observesTrackingScrollViewScrollEvents property allows the FlexibleHeader to automatically observe content offset changes to the tracking scroll view, removing the need for forwarding the UIScrollViewDelegate events to the FlexibleHeader. Note: you can only use this new feature if you have not enabled the shift behavior.

API changes

AppBar

MDCAppBarNavigationController

new class: MDCAppBarNavigationController

new property: delegate in MDCAppBarNavigationController

new method: -appBarForViewController: in MDCAppBarNavigationController

MDCAppBarNavigationControllerDelegate

new protocol: MDCAppBarNavigationControllerDelegate

new method: -appBarNavigationController:willAddAppBar:asChildOfViewController: in MDCAppBarNavigationControllerDelegate

MDCAppBar

new property: inferTopSafeAreaInsetFromViewController in MDCAppBar

FlexibleHeader

MDCFlexibleHeaderView

new property: observesTrackingScrollViewScrollEvents in MDCFlexibleHeaderView

Component changes

AppBar

Changes

Ink

Changes

Snackbar

Changes

Cards

Changes

LibraryInfo

Changes

Dialogs

Changes

BottomNavigation

Changes

FlexibleHeader

Changes