Material Components v59.1.0 Release Notes
-
π AppBar and FlexibleHeader shipped several new features in this release and Snackbar's manager is now implemented as a true singleton. 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. }
0οΈβ£ 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.β MDCSnackbarManager is now implemented as a true singleton with the ability to also create individual instances, making it possible to write self-contained tests for the component.
API changes
AppBar
MDCAppBarNavigationController
π new class:
MDCAppBarNavigationController
π new property:
delegate
inMDCAppBarNavigationController
π new method:
-appBarForViewController:
inMDCAppBarNavigationController
MDCAppBarNavigationControllerDelegate
π new protocol:
MDCAppBarNavigationControllerDelegate
π new method:
-appBarNavigationController:willAddAppBar:asChildOfViewController:
inMDCAppBarNavigationControllerDelegate
MDCAppBar
π new property:
inferTopSafeAreaInsetFromViewController
inMDCAppBar
FlexibleHeader
MDCFlexibleHeaderView
π new property:
observesTrackingScrollViewScrollEvents
inMDCFlexibleHeaderView
Component changes
AppBar
π Changes
- Add an inferTopSafeAreaInsetFromViewController behavior. (#4648) (featherless)
- Add new MDCAppBarNavigationController API. (#4650) (featherless)
- π [FlexibleHeader] Add support for observing the tracking scroll view. (#4647) (featherless)
Ink
π Changes
- [Catalog] Improve Ink demo color contrast (#4660) (Robert Moore)
- add commonMDCInkViewInit call to -initWithCoder: (#4662) (Andrew Overton)
Snackbar
π Changes
- Create explicit singleton (#4556) (Robert Moore)
- βͺ Revert "Create explicit singleton (#4556)" (Jeff Verkoeyen)
Cards
π Changes
- accessibility example for collection cards (#4488) (Galia Kaufman)
- π Accessibility: Fixing documentation typos (#4634) (Galia Kaufman)
LibraryInfo
π Changes
- Version bump. (Jeff Verkoeyen)
π Dialogs
π Changes
- Best example description (#4643) (ianegordon)
- β‘οΈ Revert "Update buttons touch area to be 48x48 minimum (#4624)" (#4675) (ianegordon)
- β‘οΈ Update buttons touch area to be 48x48 minimum (#4624) (Cody Weaver)
BottomNavigation
π Changes
- β‘οΈ Explicitly update label visibility after titleVisibility is set (#4635) (Andrew Overton)
- Fix delayed ink ripple (#4625) (Robert Moore)
- Give UITabBarItems' accessibilityIdentifiers to MDCBottomNavigationBa⦠(#4599) (Andrew Overton)
FlexibleHeader
π Changes
- π Add support for observing the tracking scroll view. (#4647) (featherless)