Releases: material-components/material-components-ios
v85.1.0
85.1.0
In this minor release we have begun development of a new Tab component, as well as additional tests and bug fixes.
New features
Chips now support selection for ripple when in the selected state.
MDCChipView *chipView = [[MDCChipView alloc] init];
chipView.enableRippleBehavior = YES;
chipView.rippleAllowsSelection = YES;
API changes
Chips
MDCChipView
new property: rippleAllowsSelection
in MDCChipView
Tabs
MDCTabBarView
new class: MDCTabBarView
Component changes
Changes
AppBar
- Use new unit test Bazel rules (#7642) (Robert Moore)
Banner
- Fix horizontal constraint between text label and button. (#7648) (Wenyu Zhang)
- Remove a redundant header file of a typical example. (#7610) (Wenyu Zhang)
- apply constraints to trailingButton even it is hidden. (#7652) (Wenyu Zhang)
- fix image constraint when it is hidden and on single row mode. (#7649) (Wenyu Zhang)
Chips
- New rippleAllowsSelection API in MDCChipView (#7613) (Galia Kaufman)
NavigationDrawer
- Update cacheLayoutCalculationsWithAddedContentHeight recursion check to factor out floating point rounding issues (#7654) (Bryan Oltman)
Tabs
- Update README for MDCTabBarView. (#7673) (Robert Moore)
- Add missing example. (#7671) (Robert Moore)
- Move "Tabs2" into an extension. (#7663) (Robert Moore)
schemes/Typography
Multi-component changes
v85.0.1
This patch release fixes a bug that Banner doesn't layout correctly in landscape mode on some devices and a floating point rounding issue in NavigationDrawer.
Changes
Banner
- Fix horizontal constraint between text label and button. (#7648) (Wenyu Zhang)
- Fix image constraint when it is hidden and on single row mode (#7649) (Wenyu Zhang)
- Apply constraints to trailingButton even it is hidden. (#7652) (Wenyu Zhang)
NavigationDrawer
v85.0.0
In this major release we updated sizeThatFits:
calculation for MDCBottomNavigationBar to not include safe area, added Ripple support to all our interactable components, and more layout customization for Banner.
Breaking changes
We have changed the sizeThatFits:
behavior for BottomNavigation's bar to not include the safe area by default. This is a breaking change as prior we did include the safe area as part of the calculation, but we should not since the view controller (or parent view) should worry about positioning the BottomNavigationBar within the unsafe area (if it desires).
If you still wish to include the safe area in the sizeThatFits calculation:
self.bottomNavigationBar.sizeThatFitsIncludesSafeArea = YES;
New features
Enable the new Ripple behavior in components by setting enableRippleBehavior
to YES, and set its color using the rippleColor
API:
MDCTabBar *tabBar = [[MDCTabBar alloc] init];
tabBar.enableRippleBehavior = YES;
tabBar.rippleColor = UIColor.blueColor;
MDCBanner supports different layout styles using the MDCBannerViewLayoutStyle
enum:
MDCBannerView *bannerView = [[MDCBannerView alloc] init];
bannerView.bannerViewLayoutStyle = MDCBannerViewLayoutStyleSingleRow;
MDCBanner now allows you to show/hide a divider:
MDCBannerView *bannerView = [[MDCBannerView alloc] init];
bannerView.showsDivider = YES;
API changes
ActionSheet
MDCActionSheetController
new property: rippleColor
in MDCActionSheetController
new property: enableRippleBehavior
in MDCActionSheetController
MDCActionSheetController(ToBeDeprecated)
new category: MDCActionSheetController(ToBeDeprecated)
modified property: inkColor
in MDCActionSheetController(ToBeDeprecated)
Type of change: | parent.usr |
---|---|
From: | c:objc(cs)MDCActionSheetController |
To: | c:objc(cy)MDCActionSheetController@ToBeDeprecated |
Banner
MDCBannerViewLayoutStyle
new enum value: MDCBannerViewLayoutStyleAutomatic
in MDCBannerViewLayoutStyle
new enum value: MDCBannerViewLayoutStyleMultiRowAlignedButton
in MDCBannerViewLayoutStyle
new enum value: MDCBannerViewLayoutStyleMultiRowStackedButton
in MDCBannerViewLayoutStyle
new enum value: MDCBannerViewLayoutStyleSingleRow
in MDCBannerViewLayoutStyle
new enum: MDCBannerViewLayoutStyle
new typedef: MDCBannerViewLayoutStyle
MDCBannerView
new property: bannerViewLayoutStyle
in MDCBannerView
new property: showsDivider
in MDCBannerView
new property: dividerColor
in MDCBannerView
BottomNavigation
MDCBottomNavigationBar(ToBeDeprecated)
new category: MDCBottomNavigationBar(ToBeDeprecated)
modified property: sizeThatFitsIncludesSafeArea
in MDCBottomNavigationBar(ToBeDeprecated)
Type of change: | parent.usr |
---|---|
From: | c:objc(cs)MDCBottomNavigationBar |
To: | c:objc(cy)MDCBottomNavigationBar@ToBeDeprecated |
MDCBottomNavigationBar
new property: enableRippleBehavior
in MDCBottomNavigationBar
ButtonBar
MDCButtonBar
new property: enableRippleBehavior
in MDCButtonBar
new property: rippleColor
in MDCButtonBar
MDCButtonBar(ToBeDeprecated)
new category: MDCButtonBar(ToBeDeprecated)
modified property: inkColor
in MDCButtonBar(ToBeDeprecated)
Type of change: | parent.usr |
---|---|
From: | c:objc(cs)MDCButtonBar |
To: | c:objc(cy)MDCButtonBar@ToBeDeprecated |
Dialogs
MDCAlertControllerView
new property: enableRippleBehavior
in MDCAlertControllerView
MDCAlertController
new property: enableRippleBehavior
in MDCAlertController
List
MDCBaseCell
new property: rippleColor
in MDCBaseCell
new property: enableRippleBehavior
in MDCBaseCell
MDCBaseCell(ToBeDeprecated)
new category: MDCBaseCell(ToBeDeprecated)
modified property: inkColor
in MDCBaseCell(ToBeDeprecated)
Type of change: | parent.usr |
---|---|
From: | c:objc(cs)MDCBaseCell |
To: | c:objc(cy)MDCBaseCell@ToBeDeprecated |
NavigationBar
MDCNavigationBar
new property: enableRippleBehavior
in MDCNavigationBar
new property: rippleColor
in MDCNavigationBar
MDCNavigationBar(ToBeDeprecated)
new category: MDCNavigationBar(ToBeDeprecated)
modified property: inkColor
in MDCNavigationBar(ToBeDeprecated)
Type of change: | parent.usr |
---|---|
From: | c:objc(cs)MDCNavigationBar |
To: | c:objc(cy)MDCNavigationBar@ToBeDeprecated |
Slider
MDCSlider(ToBeDeprecated)
new category: MDCSlider(ToBeDeprecated)
modified property: inkColor
in MDCSlider(ToBeDeprecated)
Type of change: | parent.usr |
---|---|
From: | c:objc(cs)MDCSlider |
To: | c:objc(cy)MDCSlider@ToBeDeprecated |
MDCSlider
new property: enableRippleBehavior
in MDCSlider
new property: rippleColor
in MDCSlider
Snackbar
MDCSnackbarMessage
new property: enableRippleBehavior
in MDCSnackbarMessage
Tabs
MDCTabBar
new property: enableRippleBehavior
in MDCTabBar
new property: rippleColor
in MDCTabBar
MDCTabBar(ToBeDeprecated)
new category: MDCTabBar(ToBeDeprecated)
modified property: inkColor
in MDCTabBar(ToBeDeprecated)
Type of change: | parent.usr |
---|---|
From: | c:objc(cs)MDCTabBar |
To: | c:objc(cy)MDCTabBar@ToBeDeprecated |
Component changes
Changes
ActionSheet
- Adds the Ripple behavior to ActionSheet. (#7594) (Yarden Eitan)
- Fixes incorrect layout margins in MDCActionSheetController's table view pre iOS 12. (#7607) (Cody Weaver)
- Simplify BottomSheet import. (#7552) (Robert Moore)
AppBar
- Update example to have accessibility elements (#7574) (Cody Weaver)
Banner
- Add support for divider in MDCBannerView. (#7567) (Wenyu Zhang)
- Drop iOS 9 annotation from MDCBannerView. (#7568) (Wenyu Zhang)
- Expose LayoutMode and add an automatic layout mode. (#7572) (Wenyu Zhang)
- Rename layoutMode to layoutStyle. (#7605) (Wenyu Zhang)
- set trailingButton default to hidden under SingleRow layout (#7604) (Wenyu Zhang)
- standardize dividerColor API. (#7575) (Wenyu Zhang)
BottomNavigation
- Adds the Ripple behavior to BottomNavigation. (#7589) (Yarden Eitan)
- Default
sizeThatFitsIncludesSafeArea
toNO
. (#7554) (Robert Moore) - Remove old and unused methods. (#7606) (Yarden Eitan)
BottomSheet
ButtonBar
- Adds the Ripple behavior to ButtonBar. (#7593) (Yarden Eitan)
Dialogs
- Adds the Ripple behavior to Dialogs. (#7595) (Yarden Eitan)
- Update DialogWithInputFieldExample storyboard to reference correct class (#7524) (Bryan Oltman)
List
- Adds the Ripple behavior to List. (#7591) (Yarden Eitan)
NavigationBar
- Adds the Ripple behavior to NavigationBar. (#7602) (Yarden Eitan)
Slider
- Adds the Ripple behavior to Slider. (#7600) (Yarden Eitan)
Snackbar
- Adds the Ripple behavior to Snackbar. (#7596) (Yarden Eitan)
- Remove dead code from Ink (#7599) (Yarden Eitan)
Tabs
- [Adds the...
v84.6.0
In this minor release we added new features to ActionSheet and NavigationDrawer, as well as additional tests and bug fixes.
New features
ActionSheet now allows clients to align all titles regardless of if an image is present or not.
let actionSheet = MDCActionSheetController()
let actionOne = MDCActionSheetAction(title: "Email",
image: nil) { (_) in
print("Email action") }
let actionTwo = MDCActionSheetAction(title: "Cancel",
image: UIImage(named: "CancelImage")) { (_) in
print("Cancel action") }
actionSheet.addAction(actionOne)
actionSheet.addAction(actionTwo)
actionSheet.alwaysAlignTitleLeadingEdges = true
NavigationDrawer now allows clients to automatically include the safeAreaInsets
in the content height calculation.
By enabling this flag the MDCBottomDrawerViewController
will add the safeAreaInsets.bottom
to the preferredContentSize.height
of the contentViewController
.
let navigationDrawer = MDCBottomDrawerViewController()
navigationDrawer.shouldIncludeSafeAreaInContentHeight = true
API changes
ActionSheet
new property: alwaysAlignTitleLeadingEdges
in MDCActionSheetController
NavigationDrawer
new property: shouldIncludeSafeAreaInContentHeight
in MDCBottomDrawerViewController
new property: shouldIncludeSafeAreaInContentHeight
in MDCBottomDrawerPresentationController
Component changes
Changes
ActionSheet
- Add snapshot test for when only some actions have images. (#7547) (Cody Weaver)
- Allow clients to align titles if only some actions have images. (#7548) (Cody Weaver)
Buttons
List
- Fix self sizing layout in iOS 13 (#7536) (Andrew Overton)
MaskedTransition
- Fix infinite loops in masked transition example (#7519) (Andrew Overton)
NavigationDrawer
- Include safe area insets in content height (#7545) (Yarden Eitan)
- update (#7544) (Yarden Eitan)
Ripple
- Add snapshot test for
maximumRadius
API. #7538 (Cody Weaver)
Tabs
- Give MDCTabBarDelegate pass through methods for "willDisplayCell"/"didEndDisplayingCell" (#7518) (Andrew Overton)
- Revert "[Tabs] Give MDCTabBarDelegate pass through methods for "willDisplayCell"/"didEndDisplayingCell" (#7518)" (Cody Weaver)
schemes/Typography
- Fix issue within the docs (#7543) (Cody Weaver)
Multi-component changes
- Fix typo (#7541) (Andrew Overton)
v84.5.0
84.5.0
In this minor release we have expanded our support for NavigationBar as well as additional tests and bug fixes.
New features
NavigationBar now allows clients to present overlay views that point to views in an MDCNavigationBar:
let leadingRect = navigationBar.rect(forLeading: leadingItem, in: view)
let trailingRect = navigationBar.rect(forTrailing: trailingItem, in: view)
// Present an overlay pointing at `leadingRect` or `trailingRect`
API changes
NavigationBar
MDCNavigationBar
new method: -rectForLeadingBarButtonItem:inCoordinateSpace
in MDCNavigationBar
new method: -rectForTrailingBarButtonItem:inCoordinateSpace
in MDCNavigationBar
Component changes
Changes
AppBar
- Update swift examples to use theming extension (#7511) (Cody Weaver)
Buttons
- Add snapshot tests for floating button theming. (#7506) (featherless)
Dialogs
- Add snapshot test for dynamic type (#7447) (Cody Weaver)
- Add test for legacy dynamic type behavior around
buttonFont
(#7509) (Cody Weaver) - Add test for legacy dynamic type with the messageFont property (#7498) (Cody Weaver)
- Test title font legacy behavior when dynamic type is enabled. (#7468) (Cody Weaver)
List
- Refactor dynamic type support to use mdc_scaledFontForTraitEnvironment. (#7495) (featherless)
- Use UICollectionView as environment in List snapshot test. (#7508) (Wenyu Zhang)
NavigationBar
- Add rectFor*Item APIs. (#7504) (featherless)
Tabs
- Allow overriding internal size class. (#7517) (Robert Moore)
TextFields
- Resolve some swift warnings. (#7529) (featherless)
Typography
- Add doc to explain fallback behavior. (#7493) (Wenyu Zhang)
Multi-component changes
- Fix fallback behavior for Dynamic Type. (#7514) (Robert Moore)
v84.4.0
In this minor release we have expanded our support for custom Dynamic Type scaling curves in Buttons, Chips, and List, as well as additional tests and bug fixes.
New deprecations
mdc_legacyFontScaling
in MDCButton
and MDCChipView
has been deprecated.
Please use adjustsFontForContentSizeCategoryWhenScaledFontIsUnavailable
instead.
New features
Buttons, Chips, and List, have expanded their support for Dynamic Type to allow custom scaling curves to be associated with fonts:
MDCButton *button = [[MDCButton alloc] init];
UIFont *customFont = [UIFont fontWithName:@"CustomFontName" size:18.0];
MDCFontScaler *fontScaler = [MDCFontScaler scalerForMaterialTextStyle:MDCTextStyleBody1];
UIFont *customScalableFont = [fontScaler scaledFontWithFont:customFont];
[button setTitleFont:customScalingFont forState:UIControlStateNormal];
Buttons, Chips, Dialogs, and List, now have a new property
adjustsFontForContentSizeCategoryWhenScaledFontIsUnavailable
that affects the fallback behavior for when a scaled font is not provided.
If set to YES the font size will adjust even if a scaled font has not been provided for a given UIFont property on this component. If set to NO, the font size will only be adjusted if a scaled font has been provided.
ButtonBar now allows clients to present overlay views that point to views in an MDCButtonBar:
let rect = buttonBar.rect(for: item, in: view)
// Present an overlay pointing at `rect`
As part of the typography component, we added a new method to UIFont mdc_scaledFontForTraitEnvironment:
that returns a font with the same family, weight and traits, but whose point size is based on the given trait environment's preferred content size category.
API changes
ButtonBar
MDCButtonBar
new method: -rectForItem:item:inCoordinateSpace
in MDCButtonBar
Buttons
MDCButton
new property: adjustsFontForContentSizeCategoryWhenScaledFontIsUnavailable
in MDCButton
deprecated property: mdc_legacyFontScaling
in MDCButton
Chips
MDCChipView
new property: adjustsFontForContentSizeCategoryWhenScaledFontIsUnavailable
in MDCChipView
deprecated property: mdc_legacyFontScaling
in MDCChipView
Dialogs
MDCAlertController
new property: adjustsFontForContentSizeCategoryWhenScaledFontIsUnavailable
in MDCAlertController
List
MDCSelfSizingStereoCell
new property: adjustsFontForContentSizeCategoryWhenScaledFontIsUnavailable
in MDCSelfSizingStereoCell
Typography
UIFont+MaterialScalable
new method: mdc_scaledFontForTraitEnvironment:traitEnvironment
in UIFont+MaterialScalable
schemes/Typography
MDCTypographyScheme
new property: useCurrentContentSizeCategoryWhenApplied
in MDCTypographyScheming
new property: useCurrentContentSizeCategoryWhenApplied
in MDCTypographyScheme
Component changes
Changes
ButtonBar
- Expose a rectForItem:inCoordinateSpace: API. (#7438) (featherless)
- Fix a typo in the docs for rectForItem:inCoordinateSpace:. (#7496) (featherless)
Buttons
- Add snapshot test for dynamic type (#7429) (Cody Weaver)
- Fix issue with legacy dynamic type (#7466) (Cody Weaver)
- Fix up test (#7461) (Cody Weaver)
- Refactor dynamic type support to use mdc_scaledFontForTraitEnvironment. (#7489) (featherless)
- Revert updating fonts after adjustsFontForContentSizeCategoryWhenScaledFontIsUnavailable has been updated (#7480) (Cody Weaver)
- Update dynamic type to match other components (#7425) (Cody Weaver)
- Update name for fallback behavior. (#7452) (Cody Weaver)
Chips
- Add fallback behavior for M2 Dynamic Type. (#7432) (Wenyu Zhang)
- Apply Dynamic Type flag to typography themer. (#7414) (Wenyu Zhang)
- Fix a flag naming in Chip theming extension and added a missing test for this flag. (#7482) (Wenyu Zhang)
- Refactor dynamic type behavior by using a convenience method. (#7494) (Wenyu Zhang)
- Use umbrella header (#7423) (Cody Weaver)
Dialogs
- Add flag for legacy behavior for dynamic type (#7446) (Cody Weaver)
- Flash scroll indicators if content is larger than the scroll view. (#7434) (Cody Weaver)
- Move the private property declaration to the header (#7433) (Cody Weaver)
List
- Add M2 Dynamic Type support for MDCSelfSizingStereoCell (#7440) (Wenyu Zhang)
- Add basic snapshot tests for MDCSelfSizingStereoCell. (#7439) (Wenyu Zhang)
- Fix copyright dates for Theming files. (#7430) (Robert Moore)
- Snapshot tests for upcoming Scalable Font behavior. (#7458) (Wenyu Zhang)
- Update snapshot golden images for dynamic type change. (#7486) (Wenyu Zhang)
- add Dynamic Type support on List Typography Themer. (#7491) (Wenyu Zhang)
NavigationDrawer
- Prevent crash when passing nil completion block for a nullable method parameter. (#7450) (Robbie Kirk)
Tabs
Typography
- Add mdc_scaledFontForTraitEnvironment. (#7471) (featherless)
- Copy-edit of UIFont+MaterialScalable.h (#7475) (featherless)
- Implement copy semantics on the UIFont's mdc_scalingCurve. (#7476) (featherless)
- Split Typography doc into separate md files. (#7435) (Wenyu Zhang)
- Update Dynamic Type section in Typography doc. (#7469) (Wenyu Zhang)
- add a brief doc for Dynamic Type support. (#7431) (Wenyu Zhang)
schemes/Typography
- Add a brief dynamic type doc for Typography scheme. (#7473) (Wenyu Zhang)
- Add useCurrentContentSizeCategoryWhenApplied. (#7465) (featherless)
- Align useCurrentContentSizeCategoryWhenApplied with internal behavior. (#7479) (featherless)
- make MDCTypographyScheme conform to NSObject. (#7485) (Wenyu Zhang)
v84.3.0
This minor release adds new theming extensions for Lists and minor bug fixes and documentation updates to multiple components.
New features
Theming extensions are now available for Lists:
let cell = MDCSelfSizingStereoCell()
let scheme = MDCContainerScheme()
cell.applyTheme(withScheme: scheme)
API changes
Chips
MDCChipView
modified class: MDCChipView
new property: mdc_legacyFontScaling
in MDCChipView
List+Theming
New extension.
Changes
Buttons
- Add snapshot test for theming extensions (#7390) (Cody Weaver)
- Remove dependency on TypographyThemer in theming extension. (#7391) (Cody Weaver)
- Update titleFont:forState: API (#7402) (Cody Weaver)
- [Ripple] fix button to update ripple states correctly (#7337) (Galia Kaufman)
- Update outline theming extension (#7403) (Cody Weaver)
Chips
- Add M2 dynamic type support to Chips. (#7394) (Wenyu Zhang)
- refactor chip title font. (#7406) (Wenyu Zhang)
FlexibleHeader
- Clarify the docs for preferredStatusBarStyle. (#7415) (featherless)
List
- Add List theming extension (#7397) (Andrew Overton)
NavigationDrawer
- Explain use of AppBar elevation (#7399) (Robert Moore)
ProgressView
- Add cornerRadius snapshot tests. (#7416) (featherless)
Multi-component changes
- Roll-forward a shadow elevation issue. (#7396) (Yarden Eitan)
v84.2.1
This patch release fixes a bug where dialogs were not indicating that their content was scrollable.
Changes
Dialogs
v84.2.0
84.2.0
This minor release adds support for a custom unbounded Ripple radius value. It also includes several
bug fixes and documentation updates to multiple components.
New features
MDCRippleView
now supports a custom ripple radius for the .unbounded
ripple style. This allows
clients to customize how far outside (or within) a view the ripple effect will extend.
MDCRippleView *rippleView = [[MDCRippleView alloc] init];
rippleView.rippleStyle = MDCRippleStyleUnbounded;
rippleView.maximumRadius = 10;
API changes
Ripple
MDCRippleView
new property: maximumRadius
in MDCRippleView
ShadowElevations
MDCShadowElevationNavDrawer
modified constant: MDCShadowElevationNavDrawer
Type of change: | Declaration |
---|---|
From: | static const MDCShadowElevation MDCShadowElevationNavDrawer = (CGFloat)16. |
To: | static const MDCShadowElevation MDCShadowElevationNavDrawer = (CGFloat)4. |
Component changes
Changes
ActionSheet
- Fixing handler error and adding missing parenthesis (#7360) (Justin Pritchard)
- Have content positioned based on the layout margins of the container. (#7331) (Yarden Eitan)
BottomNavigation
- Log accessibility string failure values in tests. (#7326) (Robert Moore)
Ink
- Add animation delegate callbacks for MDCLegacyInkLayer (#7339) (Michael Schneider)
NavigationDrawer
- update (#7345) (Yarden Eitan)
Ripple
- Add a migration guide for components (#7367) (Yarden Eitan)
- Add max ripple radius property (#7357) (Cody Weaver)
- Make rippleRadius a property (#7350) (Cody Weaver)
TextFields
- Quash -Wsign-compare triggers (#7358) (featherless)
Snapshot (private)
- Split implementation and supplemental. (#7356) (Robert Moore)
Multi-component changes
- Roll-forward a shadow elevation issue. (#7396) (Yarden Eitan)
- Update Readme to use the script generator and move migration guide. (#7370) (Yarden Eitan)
v84.1.1
This patch release fixes ActionSheet to lay out its content correctly when there is a safe area present, for iOS 11 and newer.