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

v87.1.0

Choose a tag to compare

@romoore romoore released this 17 Aug 01:36
· 2466 commits to stable since this release

This minor release enhances support for Material Elevation in Text Fields and
Snackbar, brings new conveniences for resolving dynamic colors, and fixes a
dynamic color bug in MDCShapedShadowLayer.

New features

Text Fields

MDCTextField now supports Material Elevation. Clients can assign a value for
mdc_overrideBaseElevation or an elevationDidChangeBlock to ensure that
both the Text Field and any subviews can react to elevation changes.

Snackbar

MDCSnackbarManager now supports assigning a
traitCollectionDidChangeBlockForMessageView and an
mdc_elevationDidChangeBlockForMessageView. These blocks make it easier to
respond to changes in either the elevation or trait collections of the
MDCSnackbarMessageView.

Material Elevation

Material Elevation has a new UIColor category method to make it easier to
optimize checking for dynamic color changes.

Previously

UIColor *resolvedColor = originalColor;
#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0)
  if (@available(iOS 13.0, *)) {
    if ([traitCollection
            hasDifferentColorAppearanceComparedToTraitCollection:previousTraitCollection]) {
      resolvedColor = [self mdc_resolvedColorWithTraitCollection:traitCollection elevation:elevation];
    }
  }
#endif

This Release

UIColor *resolvedColor =
        [dynamicColor mdc_resolvedColorWithTraitCollection:currentTraitCollection
                                   previousTraitCollection:previousTraitCollection
                                                 elevation:elevation];

API changes

Elevation

UIColor(MaterialElevation)

new method: -mdc_resolvedColorWithTraitCollection:previousTraitCollection:elevation: in UIColor(MaterialElevation)

Snackbar

MDCSnackbarManager

new property: mdc_elevationDidChangeBlockForMessageView in MDCSnackbarManager

new property: traitCollectionDidChangeBlockForMessageView in MDCSnackbarManager

TextFields

MDCTextField

modified class: MDCTextField

Type of change: Swift declaration
From: class MDCTextField : UITextField, MDCTextInput, MDCLeadingViewTextInput
To: class MDCTextField : UITextField

modified class: MDCTextField

Type of change: Declaration
From: @interface MDCTextField : UITextField <MDCTextInput, MDCLeadingViewTextInput>
To: @interface MDCTextField : UITextField

Changes

Elevation

Shapes

Snackbar

TextFields

private/Color