Skip to content

Commit

Permalink
Merge branch 'release-candidate' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
codeman7 committed Mar 4, 2021
2 parents c3cec9d + 43fad8d commit d1e70a4
Show file tree
Hide file tree
Showing 108 changed files with 148 additions and 4,670 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
# 124.0.0

In this release `MDCTextField` and its associated classes and protocols are deprecated. We also deleted the Pesto example application and cleaned up pre iOS 12 checks in the library.

## Breaking changes

`MDCTextField` and its associated classes and protocols are deprecated.

## API changes

* All classes and protocols under in the `components/TextFields` folder are now deprecated.

## Component changes

### TextFields

* [Deprecate MDCTextField and its associated classes/protocols](https://github.com/material-components/material-components-ios/commit/a29eb2c3c7408a891dadca4613e97ddc67bdbbf5) (Andrew Overton)

## Multi-component changes

* [Internal change](https://github.com/material-components/material-components-ios/commit/b64b0ec23150deef32205c38b0a274171639644b) (Jeff Verkoeyen)

---

# 123.0.0

In this major release we have made the MDCBottomNavigationBarController class and its APIs only be available from iOS 12 and up.
Expand Down
2 changes: 1 addition & 1 deletion MaterialComponents.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ load 'scripts/generated/icons.rb'

Pod::Spec.new do |mdc|
mdc.name = "MaterialComponents"
mdc.version = "123.0.0"
mdc.version = "124.0.0"
mdc.authors = "The Material Components authors."
mdc.summary = "A collection of stand-alone production-ready UI libraries focused on design details."
mdc.homepage = "https://github.com/material-components/material-components-ios"
Expand Down
2 changes: 1 addition & 1 deletion MaterialComponentsEarlGreyTests.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "MaterialComponentsEarlGreyTests"
s.version = "123.0.0"
s.version = "124.0.0"
s.authors = "The Material Components authors."
s.summary = "This spec is an aggregate of all the Material Components EarlGrey tests."
s.description = "This spec is made for use in the MDC Catalog."
Expand Down
2 changes: 1 addition & 1 deletion MaterialComponentsExamples.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "MaterialComponentsExamples"
s.version = "123.0.0"
s.version = "124.0.0"
s.authors = "The Material Components authors."
s.summary = "This spec is an aggregate of all the Material Components examples."
s.description = "This spec is made for use in the MDC Catalog. Used in conjunction with CatalogByConvention we create our Material Catalog."
Expand Down
2 changes: 1 addition & 1 deletion MaterialComponentsSnapshotTests.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ end

Pod::Spec.new do |s|
s.name = "MaterialComponentsSnapshotTests"
s.version = "123.0.0"
s.version = "124.0.0"
s.authors = "The Material Components authors."
s.summary = "This spec is an aggregate of all the Material Components snapshot tests."
s.homepage = "https://github.com/material-components/material-components-ios"
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
123.0.0
124.0.0
4 changes: 2 additions & 2 deletions catalog/MDCCatalog/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>123.0.0</string>
<string>124.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>123.0.0</string>
<string>124.0.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIAppFonts</key>
Expand Down
4 changes: 2 additions & 2 deletions catalog/MDCDragons/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>123.0.0</string>
<string>124.0.0</string>
<key>CFBundleVersion</key>
<string>123.0.0</string>
<string>124.0.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
Expand Down
2 changes: 1 addition & 1 deletion catalog/MaterialCatalog/MaterialCatalog.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "MaterialCatalog"
s.version = "123.0.0"
s.version = "124.0.0"
s.summary = "Helper Objective-C classes for the MDC catalog."
s.description = "This spec is made for use in the MDC Catalog."
s.homepage = "https://github.com/material-components/material-components-ios"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,7 @@ - (void)viewDidLoad {
UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
self.featureHighlightView.mdc_adjustsFontForContentSizeCategory =
_mdc_adjustsFontForContentSizeCategory;
if (@available(iOS 10.0, *)) {
self.featureHighlightView.adjustsFontForContentSizeCategory =
_adjustsFontForContentSizeCategory;
}
self.featureHighlightView.adjustsFontForContentSizeCategory = _adjustsFontForContentSizeCategory;
self.featureHighlightView.mdc_legacyFontScaling = _mdc_legacyFontScaling;

__weak MDCFeatureHighlightViewController *weakSelf = self;
Expand Down
2 changes: 1 addition & 1 deletion components/LibraryInfo/src/MDCLibraryInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// This string is updated automatically as a part of the release process and should not be edited
// manually. Do not rename this constant or change the formatting without updating the release
// scripts.
static NSString* const kMDCLibraryInfoVersionString = @"123.0.0";
static NSString* const kMDCLibraryInfoVersionString = @"124.0.0";

@implementation MDCLibraryInfo

Expand Down
2 changes: 1 addition & 1 deletion components/LibraryInfo/tests/unit/LibraryInfoTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ - (void)testVersionFormat {
// Given

// This regex pattern does the following:
// Accept: "123.0.0", etc.
// Accept: "124.0.0", etc.
// Reject: "0.0.0", "1.2", "1", "-1.2.3", "Hi, I'm a version 1.2.3", "1.2.3 is my version", etc.
//
// Note the major version must be >= 1 since "0.0.0" is used as the version when something goes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
static NSString *const kExampleDetailText =
@"Pellentesque non quam ornare, porta urna sed, malesuada felis. Praesent at gravida felis, "
"non facilisis enim. Proin dapibus laoreet lorem, in viverra leo dapibus a.";
static const CGFloat kSmallestCellHeight = 40;
static const CGFloat kSmallArbitraryCellWidth = 100;

@implementation CollectionListCellExampleTypicalUse {
NSMutableArray *_content;
Expand All @@ -35,11 +33,7 @@ - (instancetype)init {
flowLayout.minimumInteritemSpacing = 0;
flowLayout.minimumLineSpacing = 1;
flowLayout.scrollDirection = UICollectionViewScrollDirectionVertical;
if (@available(iOS 10.0, *)) {
flowLayout.estimatedItemSize = UICollectionViewFlowLayoutAutomaticSize;
} else {
flowLayout.estimatedItemSize = CGSizeMake(kSmallArbitraryCellWidth, kSmallestCellHeight);
}
flowLayout.estimatedItemSize = UICollectionViewFlowLayoutAutomaticSize;
return [self initWithCollectionViewLayout:flowLayout];
}

Expand Down
8 changes: 3 additions & 5 deletions components/Tabs/src/private/MDCItemBarCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,9 @@ - (void)updateWithItem:(UITabBarItem *)item
self.selectedImage = item.selectedImage;
self.image = item.image;
self.badgeValue = item.badgeValue;
if (@available(iOS 10.0, *)) {
if (item.badgeColor) {
self.style.badgeColor = item.badgeColor;
self.badge.badgeColor = item.badgeColor;
}
if (item.badgeColor) {
self.style.badgeColor = item.badgeColor;
self.badge.badgeColor = item.badgeColor;
}
self.accessibilityIdentifier = item.accessibilityIdentifier;
self.accessibilityLabel = item.accessibilityLabel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,23 +131,18 @@ - (void)decreaseContentSizeForChildViewController:(UIViewController *)childViewC

- (void)setContentSizeCategory:(UIContentSizeCategory)contentSizeCategory
onChildViewController:(UIViewController *)viewController {
if (@available(iOS 10.0, *)) {
UITraitCollection *contentSizeCategoryTraitCollection =
[UITraitCollection traitCollectionWithPreferredContentSizeCategory:contentSizeCategory];
UITraitCollection *currentTraitCollection = viewController.traitCollection;
NSArray *traitCollections = @[ currentTraitCollection, contentSizeCategoryTraitCollection ];
UITraitCollection *traitCollection =
[UITraitCollection traitCollectionWithTraitsFromCollections:traitCollections];
[self setOverrideTraitCollection:traitCollection forChildViewController:viewController];
[self.view setNeedsLayout];
}
UITraitCollection *contentSizeCategoryTraitCollection =
[UITraitCollection traitCollectionWithPreferredContentSizeCategory:contentSizeCategory];
UITraitCollection *currentTraitCollection = viewController.traitCollection;
NSArray *traitCollections = @[ currentTraitCollection, contentSizeCategoryTraitCollection ];
UITraitCollection *traitCollection =
[UITraitCollection traitCollectionWithTraitsFromCollections:traitCollections];
[self setOverrideTraitCollection:traitCollection forChildViewController:viewController];
[self.view setNeedsLayout];
}

- (UIContentSizeCategory)contentSizeCategoryForViewController:(UIViewController *)viewController {
if (@available(iOS 10.0, *)) {
return viewController.traitCollection.preferredContentSizeCategory;
}
return nil;
return viewController.traitCollection.preferredContentSizeCategory;
}

- (void)setContainerScheme:(id<MDCContainerScheming>)containerScheme {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,7 @@ - (MDCButton *)createContentSizeButtonWithTitle:(NSString *)title selector:(SEL)
[button addTarget:self action:selector forControlEvents:UIControlEventTouchUpInside];
[button applyContainedThemeWithScheme:self.containerScheme];
[button sizeToFit];
button.enabled = NO;
if (@available(iOS 10.0, *)) {
button.enabled = YES;
}
button.enabled = YES;
return button;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,20 +147,18 @@ - (void)resizeScrollViewSubviews {
- (void)enforcePreferredFonts {
[super enforcePreferredFonts];

if (@available(iOS 10.0, *)) {
[self.allTextAreas
enumerateObjectsUsingBlock:^(MDCBaseTextArea *textArea, NSUInteger idx, BOOL *stop) {
textArea.textView.adjustsFontForContentSizeCategory = YES;
textArea.textView.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody
compatibleWithTraitCollection:textArea.traitCollection];
textArea.leadingAssistiveLabel.font =
[UIFont preferredFontForTextStyle:UIFontTextStyleCaption2
compatibleWithTraitCollection:textArea.traitCollection];
textArea.trailingAssistiveLabel.font =
[UIFont preferredFontForTextStyle:UIFontTextStyleCaption2
compatibleWithTraitCollection:textArea.traitCollection];
}];
}
[self.allTextAreas
enumerateObjectsUsingBlock:^(MDCBaseTextArea *textArea, NSUInteger idx, BOOL *stop) {
textArea.textView.adjustsFontForContentSizeCategory = YES;
textArea.textView.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody
compatibleWithTraitCollection:textArea.traitCollection];
textArea.leadingAssistiveLabel.font =
[UIFont preferredFontForTextStyle:UIFontTextStyleCaption2
compatibleWithTraitCollection:textArea.traitCollection];
textArea.trailingAssistiveLabel.font =
[UIFont preferredFontForTextStyle:UIFontTextStyleCaption2
compatibleWithTraitCollection:textArea.traitCollection];
}];
}

- (void)handleResignFirstResponderTapped {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,20 +172,18 @@ - (void)resizeScrollViewSubviews {
- (void)enforcePreferredFonts {
[super enforcePreferredFonts];

if (@available(iOS 10.0, *)) {
[self.allTextFields
enumerateObjectsUsingBlock:^(MDCBaseTextField *textField, NSUInteger idx, BOOL *stop) {
textField.adjustsFontForContentSizeCategory = YES;
textField.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody
compatibleWithTraitCollection:textField.traitCollection];
textField.leadingAssistiveLabel.font =
[UIFont preferredFontForTextStyle:UIFontTextStyleCaption2
compatibleWithTraitCollection:textField.traitCollection];
textField.trailingAssistiveLabel.font =
[UIFont preferredFontForTextStyle:UIFontTextStyleCaption2
compatibleWithTraitCollection:textField.traitCollection];
}];
}
[self.allTextFields
enumerateObjectsUsingBlock:^(MDCBaseTextField *textField, NSUInteger idx, BOOL *stop) {
textField.adjustsFontForContentSizeCategory = YES;
textField.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody
compatibleWithTraitCollection:textField.traitCollection];
textField.leadingAssistiveLabel.font =
[UIFont preferredFontForTextStyle:UIFontTextStyleCaption2
compatibleWithTraitCollection:textField.traitCollection];
textField.trailingAssistiveLabel.font =
[UIFont preferredFontForTextStyle:UIFontTextStyleCaption2
compatibleWithTraitCollection:textField.traitCollection];
}];
}

- (void)handleResignFirstResponderTapped {
Expand Down
12 changes: 4 additions & 8 deletions components/TextControls/src/BaseTextAreas/MDCBaseTextArea.m
Original file line number Diff line number Diff line change
Expand Up @@ -398,14 +398,10 @@ - (CGFloat)numberOfLinesOfVisibleText {
#pragma mark Dynamic Type

- (void)setAdjustsFontForContentSizeCategory:(BOOL)adjustsFontForContentSizeCategory {
if (@available(iOS 10.0, *)) {
_adjustsFontForContentSizeCategory = adjustsFontForContentSizeCategory;
self.textView.adjustsFontForContentSizeCategory = adjustsFontForContentSizeCategory;
self.leadingAssistiveLabel.adjustsFontForContentSizeCategory =
adjustsFontForContentSizeCategory;
self.trailingAssistiveLabel.adjustsFontForContentSizeCategory =
adjustsFontForContentSizeCategory;
}
_adjustsFontForContentSizeCategory = adjustsFontForContentSizeCategory;
self.textView.adjustsFontForContentSizeCategory = adjustsFontForContentSizeCategory;
self.leadingAssistiveLabel.adjustsFontForContentSizeCategory = adjustsFontForContentSizeCategory;
self.trailingAssistiveLabel.adjustsFontForContentSizeCategory = adjustsFontForContentSizeCategory;
}

#pragma mark MDCTextControlState
Expand Down
4 changes: 3 additions & 1 deletion components/TextFields/src/MDCIntrinsicHeightTextView.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
NOTE: UITextView is a subclass of UIScrollView. That's why it has a contentSize.
*/

@interface MDCIntrinsicHeightTextView : UITextView
__deprecated_msg(
"MDCTextField and its associated classes are deprecated. Please use TextControls instead.")
@interface MDCIntrinsicHeightTextView : UITextView

@end
6 changes: 4 additions & 2 deletions components/TextFields/src/MDCMultilineTextField.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
Material Design themed mutiline text field (multiline text input).
https://www.google.com/design/spec/components/text-fields.html#text-fields-multi-line-text-field
*/
@interface MDCMultilineTextField
: UIView <MDCTextInput, MDCMultilineTextInput, MDCElevatable, MDCElevationOverriding>
__deprecated_msg(
"MDCTextField and its associated classes are deprecated. Please use TextControls instead.")
@interface MDCMultilineTextField
: UIView<MDCTextInput, MDCMultilineTextInput, MDCElevatable, MDCElevationOverriding>

/** A mirror of the same property that already exists on UITextField, UITextView, and UILabel. */
@property(nonatomic, assign) BOOL adjustsFontForContentSizeCategory;
Expand Down
4 changes: 3 additions & 1 deletion components/TextFields/src/MDCMultilineTextInputDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

#import <UIKit/UIKit.h>

@protocol MDCMultilineTextInputDelegate <NSObject>
__deprecated_msg(
"MDCTextField and its associated classes are deprecated. Please use TextControls instead.")
@protocol MDCMultilineTextInputDelegate<NSObject>

@optional

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@

@protocol MDCMultilineTextInput;

@protocol MDCMultilineTextInputLayoutDelegate <NSObject>
__deprecated_msg(
"MDCTextField and its associated classes are deprecated. Please use TextControls instead.")
@protocol MDCMultilineTextInputLayoutDelegate<NSObject>

@optional
/**
Expand Down
6 changes: 4 additions & 2 deletions components/TextFields/src/MDCTextField.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ extern NSString *_Nonnull const MDCTextInputDidToggleEnabledNotification;
Material Design compliant single-line text input.
https://www.google.com/design/spec/components/text-fields.html#text-fields-single-line-text-field
*/
@interface MDCTextField
: UITextField <MDCTextInput, MDCLeadingViewTextInput, MDCElevatable, MDCElevationOverriding>
__deprecated_msg(
"MDCTextField and its associated classes are deprecated. Please use TextControls instead.")
@interface MDCTextField
: UITextField<MDCTextInput, MDCLeadingViewTextInput, MDCElevatable, MDCElevationOverriding>

/** MDCTextField does not implement borders that conform to UITextBorderStyle. */
@property(nonatomic, assign) UITextBorderStyle borderStyle NS_UNAVAILABLE;
Expand Down
4 changes: 3 additions & 1 deletion components/TextFields/src/MDCTextFieldPositioningDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
Usually, these methods are direct mirrors of internal methods with the addition of a default value.
*/

@protocol MDCTextInputPositioningDelegate <NSObject>
__deprecated_msg(
"MDCTextField and its associated classes are deprecated. Please use TextControls instead.")
@protocol MDCTextInputPositioningDelegate<NSObject>

@optional

Expand Down
8 changes: 6 additions & 2 deletions components/TextFields/src/MDCTextInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ typedef NS_ENUM(NSUInteger, MDCTextInputTextInsetsMode) {
@protocol MDCTextInputPositioningDelegate;

/** Common API for Material Design compliant text inputs. */
@protocol MDCTextInput <NSObject>
__deprecated_msg(
"MDCTextField and its associated classes are deprecated. Please use TextControls instead.")
@protocol MDCTextInput<NSObject>

/**
The attributed text string of the placeholder label.
Expand Down Expand Up @@ -232,7 +234,9 @@ Common API for text inputs that support having a leading view.
MDCTextField implements this protocol but MDCMultilineTextField does not because the designers
determined multiline text fields should only have trailing views.
*/
@protocol MDCLeadingViewTextInput <MDCTextInput>
__deprecated_msg(
"MDCTextField and its associated classes are deprecated. Please use TextControls instead.")
@protocol MDCLeadingViewTextInput<MDCTextInput>

/**
An overlay view on the leading side.
Expand Down
4 changes: 3 additions & 1 deletion components/TextFields/src/MDCTextInputBorderView.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

#import <UIKit/UIKit.h>

@interface MDCTextInputBorderView : UIView <NSCopying>
__deprecated_msg(
"MDCTextField and its associated classes are deprecated. Please use TextControls instead.")
@interface MDCTextInputBorderView : UIView<NSCopying>

/**
The color of the area inside the border.
Expand Down
Loading

0 comments on commit d1e70a4

Please sign in to comment.