Skip to content

Commit d1e70a4

Browse files
committed
Merge branch 'release-candidate' into stable
2 parents c3cec9d + 43fad8d commit d1e70a4

File tree

108 files changed

+148
-4670
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+148
-4670
lines changed

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
# 124.0.0
2+
3+
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.
4+
5+
## Breaking changes
6+
7+
`MDCTextField` and its associated classes and protocols are deprecated.
8+
9+
## API changes
10+
11+
* All classes and protocols under in the `components/TextFields` folder are now deprecated.
12+
13+
## Component changes
14+
15+
### TextFields
16+
17+
* [Deprecate MDCTextField and its associated classes/protocols](https://github.com/material-components/material-components-ios/commit/a29eb2c3c7408a891dadca4613e97ddc67bdbbf5) (Andrew Overton)
18+
19+
## Multi-component changes
20+
21+
* [Internal change](https://github.com/material-components/material-components-ios/commit/b64b0ec23150deef32205c38b0a274171639644b) (Jeff Verkoeyen)
22+
23+
---
24+
125
# 123.0.0
226

327
In this major release we have made the MDCBottomNavigationBarController class and its APIs only be available from iOS 12 and up.

MaterialComponents.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ load 'scripts/generated/icons.rb'
22

33
Pod::Spec.new do |mdc|
44
mdc.name = "MaterialComponents"
5-
mdc.version = "123.0.0"
5+
mdc.version = "124.0.0"
66
mdc.authors = "The Material Components authors."
77
mdc.summary = "A collection of stand-alone production-ready UI libraries focused on design details."
88
mdc.homepage = "https://github.com/material-components/material-components-ios"

MaterialComponentsEarlGreyTests.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "MaterialComponentsEarlGreyTests"
3-
s.version = "123.0.0"
3+
s.version = "124.0.0"
44
s.authors = "The Material Components authors."
55
s.summary = "This spec is an aggregate of all the Material Components EarlGrey tests."
66
s.description = "This spec is made for use in the MDC Catalog."

MaterialComponentsExamples.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "MaterialComponentsExamples"
3-
s.version = "123.0.0"
3+
s.version = "124.0.0"
44
s.authors = "The Material Components authors."
55
s.summary = "This spec is an aggregate of all the Material Components examples."
66
s.description = "This spec is made for use in the MDC Catalog. Used in conjunction with CatalogByConvention we create our Material Catalog."

MaterialComponentsSnapshotTests.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ end
5353

5454
Pod::Spec.new do |s|
5555
s.name = "MaterialComponentsSnapshotTests"
56-
s.version = "123.0.0"
56+
s.version = "124.0.0"
5757
s.authors = "The Material Components authors."
5858
s.summary = "This spec is an aggregate of all the Material Components snapshot tests."
5959
s.homepage = "https://github.com/material-components/material-components-ios"

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
123.0.0
1+
124.0.0

catalog/MDCCatalog/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
<key>CFBundlePackageType</key>
1616
<string>APPL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>123.0.0</string>
18+
<string>124.0.0</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>123.0.0</string>
22+
<string>124.0.0</string>
2323
<key>LSRequiresIPhoneOS</key>
2424
<true/>
2525
<key>UIAppFonts</key>

catalog/MDCDragons/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
<key>CFBundlePackageType</key>
1616
<string>APPL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>123.0.0</string>
18+
<string>124.0.0</string>
1919
<key>CFBundleVersion</key>
20-
<string>123.0.0</string>
20+
<string>124.0.0</string>
2121
<key>LSRequiresIPhoneOS</key>
2222
<true/>
2323
<key>UILaunchStoryboardName</key>

catalog/MaterialCatalog/MaterialCatalog.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "MaterialCatalog"
3-
s.version = "123.0.0"
3+
s.version = "124.0.0"
44
s.summary = "Helper Objective-C classes for the MDC catalog."
55
s.description = "This spec is made for use in the MDC Catalog."
66
s.homepage = "https://github.com/material-components/material-components-ios"

components/FeatureHighlight/src/MDCFeatureHighlightViewController.m

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,7 @@ - (void)viewDidLoad {
6565
UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
6666
self.featureHighlightView.mdc_adjustsFontForContentSizeCategory =
6767
_mdc_adjustsFontForContentSizeCategory;
68-
if (@available(iOS 10.0, *)) {
69-
self.featureHighlightView.adjustsFontForContentSizeCategory =
70-
_adjustsFontForContentSizeCategory;
71-
}
68+
self.featureHighlightView.adjustsFontForContentSizeCategory = _adjustsFontForContentSizeCategory;
7269
self.featureHighlightView.mdc_legacyFontScaling = _mdc_legacyFontScaling;
7370

7471
__weak MDCFeatureHighlightViewController *weakSelf = self;

components/LibraryInfo/src/MDCLibraryInfo.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
// This string is updated automatically as a part of the release process and should not be edited
2020
// manually. Do not rename this constant or change the formatting without updating the release
2121
// scripts.
22-
static NSString* const kMDCLibraryInfoVersionString = @"123.0.0";
22+
static NSString* const kMDCLibraryInfoVersionString = @"124.0.0";
2323

2424
@implementation MDCLibraryInfo
2525

components/LibraryInfo/tests/unit/LibraryInfoTests.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ - (void)testVersionFormat {
2626
// Given
2727

2828
// This regex pattern does the following:
29-
// Accept: "123.0.0", etc.
29+
// Accept: "124.0.0", etc.
3030
// 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.
3131
//
3232
// Note the major version must be >= 1 since "0.0.0" is used as the version when something goes

components/List/examples/CollectionListCellExampleTypicalUse.m

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
static NSString *const kExampleDetailText =
2222
@"Pellentesque non quam ornare, porta urna sed, malesuada felis. Praesent at gravida felis, "
2323
"non facilisis enim. Proin dapibus laoreet lorem, in viverra leo dapibus a.";
24-
static const CGFloat kSmallestCellHeight = 40;
25-
static const CGFloat kSmallArbitraryCellWidth = 100;
2624

2725
@implementation CollectionListCellExampleTypicalUse {
2826
NSMutableArray *_content;
@@ -35,11 +33,7 @@ - (instancetype)init {
3533
flowLayout.minimumInteritemSpacing = 0;
3634
flowLayout.minimumLineSpacing = 1;
3735
flowLayout.scrollDirection = UICollectionViewScrollDirectionVertical;
38-
if (@available(iOS 10.0, *)) {
39-
flowLayout.estimatedItemSize = UICollectionViewFlowLayoutAutomaticSize;
40-
} else {
41-
flowLayout.estimatedItemSize = CGSizeMake(kSmallArbitraryCellWidth, kSmallestCellHeight);
42-
}
36+
flowLayout.estimatedItemSize = UICollectionViewFlowLayoutAutomaticSize;
4337
return [self initWithCollectionViewLayout:flowLayout];
4438
}
4539

components/Tabs/src/private/MDCItemBarCell.m

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,9 @@ - (void)updateWithItem:(UITabBarItem *)item
228228
self.selectedImage = item.selectedImage;
229229
self.image = item.image;
230230
self.badgeValue = item.badgeValue;
231-
if (@available(iOS 10.0, *)) {
232-
if (item.badgeColor) {
233-
self.style.badgeColor = item.badgeColor;
234-
self.badge.badgeColor = item.badgeColor;
235-
}
231+
if (item.badgeColor) {
232+
self.style.badgeColor = item.badgeColor;
233+
self.badge.badgeColor = item.badgeColor;
236234
}
237235
self.accessibilityIdentifier = item.accessibilityIdentifier;
238236
self.accessibilityLabel = item.accessibilityLabel;

components/TextControls/examples/supplemental/MDCTextControlConfiguratorExample.m

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -131,23 +131,18 @@ - (void)decreaseContentSizeForChildViewController:(UIViewController *)childViewC
131131

132132
- (void)setContentSizeCategory:(UIContentSizeCategory)contentSizeCategory
133133
onChildViewController:(UIViewController *)viewController {
134-
if (@available(iOS 10.0, *)) {
135-
UITraitCollection *contentSizeCategoryTraitCollection =
136-
[UITraitCollection traitCollectionWithPreferredContentSizeCategory:contentSizeCategory];
137-
UITraitCollection *currentTraitCollection = viewController.traitCollection;
138-
NSArray *traitCollections = @[ currentTraitCollection, contentSizeCategoryTraitCollection ];
139-
UITraitCollection *traitCollection =
140-
[UITraitCollection traitCollectionWithTraitsFromCollections:traitCollections];
141-
[self setOverrideTraitCollection:traitCollection forChildViewController:viewController];
142-
[self.view setNeedsLayout];
143-
}
134+
UITraitCollection *contentSizeCategoryTraitCollection =
135+
[UITraitCollection traitCollectionWithPreferredContentSizeCategory:contentSizeCategory];
136+
UITraitCollection *currentTraitCollection = viewController.traitCollection;
137+
NSArray *traitCollections = @[ currentTraitCollection, contentSizeCategoryTraitCollection ];
138+
UITraitCollection *traitCollection =
139+
[UITraitCollection traitCollectionWithTraitsFromCollections:traitCollections];
140+
[self setOverrideTraitCollection:traitCollection forChildViewController:viewController];
141+
[self.view setNeedsLayout];
144142
}
145143

146144
- (UIContentSizeCategory)contentSizeCategoryForViewController:(UIViewController *)viewController {
147-
if (@available(iOS 10.0, *)) {
148-
return viewController.traitCollection.preferredContentSizeCategory;
149-
}
150-
return nil;
145+
return viewController.traitCollection.preferredContentSizeCategory;
151146
}
152147

153148
- (void)setContainerScheme:(id<MDCContainerScheming>)containerScheme {

components/TextControls/examples/supplemental/MDCTextControlContentViewController.m

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,7 @@ - (MDCButton *)createContentSizeButtonWithTitle:(NSString *)title selector:(SEL)
144144
[button addTarget:self action:selector forControlEvents:UIControlEventTouchUpInside];
145145
[button applyContainedThemeWithScheme:self.containerScheme];
146146
[button sizeToFit];
147-
button.enabled = NO;
148-
if (@available(iOS 10.0, *)) {
149-
button.enabled = YES;
150-
}
147+
button.enabled = YES;
151148
return button;
152149
}
153150

components/TextControls/examples/supplemental/MDCTextControlTextAreaContentViewController.m

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -147,20 +147,18 @@ - (void)resizeScrollViewSubviews {
147147
- (void)enforcePreferredFonts {
148148
[super enforcePreferredFonts];
149149

150-
if (@available(iOS 10.0, *)) {
151-
[self.allTextAreas
152-
enumerateObjectsUsingBlock:^(MDCBaseTextArea *textArea, NSUInteger idx, BOOL *stop) {
153-
textArea.textView.adjustsFontForContentSizeCategory = YES;
154-
textArea.textView.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody
155-
compatibleWithTraitCollection:textArea.traitCollection];
156-
textArea.leadingAssistiveLabel.font =
157-
[UIFont preferredFontForTextStyle:UIFontTextStyleCaption2
158-
compatibleWithTraitCollection:textArea.traitCollection];
159-
textArea.trailingAssistiveLabel.font =
160-
[UIFont preferredFontForTextStyle:UIFontTextStyleCaption2
161-
compatibleWithTraitCollection:textArea.traitCollection];
162-
}];
163-
}
150+
[self.allTextAreas
151+
enumerateObjectsUsingBlock:^(MDCBaseTextArea *textArea, NSUInteger idx, BOOL *stop) {
152+
textArea.textView.adjustsFontForContentSizeCategory = YES;
153+
textArea.textView.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody
154+
compatibleWithTraitCollection:textArea.traitCollection];
155+
textArea.leadingAssistiveLabel.font =
156+
[UIFont preferredFontForTextStyle:UIFontTextStyleCaption2
157+
compatibleWithTraitCollection:textArea.traitCollection];
158+
textArea.trailingAssistiveLabel.font =
159+
[UIFont preferredFontForTextStyle:UIFontTextStyleCaption2
160+
compatibleWithTraitCollection:textArea.traitCollection];
161+
}];
164162
}
165163

166164
- (void)handleResignFirstResponderTapped {

components/TextControls/examples/supplemental/MDCTextControlTextFieldContentViewController.m

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -172,20 +172,18 @@ - (void)resizeScrollViewSubviews {
172172
- (void)enforcePreferredFonts {
173173
[super enforcePreferredFonts];
174174

175-
if (@available(iOS 10.0, *)) {
176-
[self.allTextFields
177-
enumerateObjectsUsingBlock:^(MDCBaseTextField *textField, NSUInteger idx, BOOL *stop) {
178-
textField.adjustsFontForContentSizeCategory = YES;
179-
textField.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody
180-
compatibleWithTraitCollection:textField.traitCollection];
181-
textField.leadingAssistiveLabel.font =
182-
[UIFont preferredFontForTextStyle:UIFontTextStyleCaption2
183-
compatibleWithTraitCollection:textField.traitCollection];
184-
textField.trailingAssistiveLabel.font =
185-
[UIFont preferredFontForTextStyle:UIFontTextStyleCaption2
186-
compatibleWithTraitCollection:textField.traitCollection];
187-
}];
188-
}
175+
[self.allTextFields
176+
enumerateObjectsUsingBlock:^(MDCBaseTextField *textField, NSUInteger idx, BOOL *stop) {
177+
textField.adjustsFontForContentSizeCategory = YES;
178+
textField.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody
179+
compatibleWithTraitCollection:textField.traitCollection];
180+
textField.leadingAssistiveLabel.font =
181+
[UIFont preferredFontForTextStyle:UIFontTextStyleCaption2
182+
compatibleWithTraitCollection:textField.traitCollection];
183+
textField.trailingAssistiveLabel.font =
184+
[UIFont preferredFontForTextStyle:UIFontTextStyleCaption2
185+
compatibleWithTraitCollection:textField.traitCollection];
186+
}];
189187
}
190188

191189
- (void)handleResignFirstResponderTapped {

components/TextControls/src/BaseTextAreas/MDCBaseTextArea.m

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -398,14 +398,10 @@ - (CGFloat)numberOfLinesOfVisibleText {
398398
#pragma mark Dynamic Type
399399

400400
- (void)setAdjustsFontForContentSizeCategory:(BOOL)adjustsFontForContentSizeCategory {
401-
if (@available(iOS 10.0, *)) {
402-
_adjustsFontForContentSizeCategory = adjustsFontForContentSizeCategory;
403-
self.textView.adjustsFontForContentSizeCategory = adjustsFontForContentSizeCategory;
404-
self.leadingAssistiveLabel.adjustsFontForContentSizeCategory =
405-
adjustsFontForContentSizeCategory;
406-
self.trailingAssistiveLabel.adjustsFontForContentSizeCategory =
407-
adjustsFontForContentSizeCategory;
408-
}
401+
_adjustsFontForContentSizeCategory = adjustsFontForContentSizeCategory;
402+
self.textView.adjustsFontForContentSizeCategory = adjustsFontForContentSizeCategory;
403+
self.leadingAssistiveLabel.adjustsFontForContentSizeCategory = adjustsFontForContentSizeCategory;
404+
self.trailingAssistiveLabel.adjustsFontForContentSizeCategory = adjustsFontForContentSizeCategory;
409405
}
410406

411407
#pragma mark MDCTextControlState

components/TextFields/src/MDCIntrinsicHeightTextView.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
NOTE: UITextView is a subclass of UIScrollView. That's why it has a contentSize.
2323
*/
2424

25-
@interface MDCIntrinsicHeightTextView : UITextView
25+
__deprecated_msg(
26+
"MDCTextField and its associated classes are deprecated. Please use TextControls instead.")
27+
@interface MDCIntrinsicHeightTextView : UITextView
2628

2729
@end

components/TextFields/src/MDCMultilineTextField.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@
2929
Material Design themed mutiline text field (multiline text input).
3030
https://www.google.com/design/spec/components/text-fields.html#text-fields-multi-line-text-field
3131
*/
32-
@interface MDCMultilineTextField
33-
: UIView <MDCTextInput, MDCMultilineTextInput, MDCElevatable, MDCElevationOverriding>
32+
__deprecated_msg(
33+
"MDCTextField and its associated classes are deprecated. Please use TextControls instead.")
34+
@interface MDCMultilineTextField
35+
: UIView<MDCTextInput, MDCMultilineTextInput, MDCElevatable, MDCElevationOverriding>
3436

3537
/** A mirror of the same property that already exists on UITextField, UITextView, and UILabel. */
3638
@property(nonatomic, assign) BOOL adjustsFontForContentSizeCategory;

components/TextFields/src/MDCMultilineTextInputDelegate.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919

2020
#import <UIKit/UIKit.h>
2121

22-
@protocol MDCMultilineTextInputDelegate <NSObject>
22+
__deprecated_msg(
23+
"MDCTextField and its associated classes are deprecated. Please use TextControls instead.")
24+
@protocol MDCMultilineTextInputDelegate<NSObject>
2325

2426
@optional
2527

components/TextFields/src/MDCMultilineTextInputLayoutDelegate.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616

1717
@protocol MDCMultilineTextInput;
1818

19-
@protocol MDCMultilineTextInputLayoutDelegate <NSObject>
19+
__deprecated_msg(
20+
"MDCTextField and its associated classes are deprecated. Please use TextControls instead.")
21+
@protocol MDCMultilineTextInputLayoutDelegate<NSObject>
2022

2123
@optional
2224
/**

components/TextFields/src/MDCTextField.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ extern NSString *_Nonnull const MDCTextInputDidToggleEnabledNotification;
2727
Material Design compliant single-line text input.
2828
https://www.google.com/design/spec/components/text-fields.html#text-fields-single-line-text-field
2929
*/
30-
@interface MDCTextField
31-
: UITextField <MDCTextInput, MDCLeadingViewTextInput, MDCElevatable, MDCElevationOverriding>
30+
__deprecated_msg(
31+
"MDCTextField and its associated classes are deprecated. Please use TextControls instead.")
32+
@interface MDCTextField
33+
: UITextField<MDCTextInput, MDCLeadingViewTextInput, MDCElevatable, MDCElevationOverriding>
3234

3335
/** MDCTextField does not implement borders that conform to UITextBorderStyle. */
3436
@property(nonatomic, assign) UITextBorderStyle borderStyle NS_UNAVAILABLE;

components/TextFields/src/MDCTextFieldPositioningDelegate.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
Usually, these methods are direct mirrors of internal methods with the addition of a default value.
2222
*/
2323

24-
@protocol MDCTextInputPositioningDelegate <NSObject>
24+
__deprecated_msg(
25+
"MDCTextField and its associated classes are deprecated. Please use TextControls instead.")
26+
@protocol MDCTextInputPositioningDelegate<NSObject>
2527

2628
@optional
2729

components/TextFields/src/MDCTextInput.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ typedef NS_ENUM(NSUInteger, MDCTextInputTextInsetsMode) {
4242
@protocol MDCTextInputPositioningDelegate;
4343

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

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

237241
/**
238242
An overlay view on the leading side.

components/TextFields/src/MDCTextInputBorderView.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414

1515
#import <UIKit/UIKit.h>
1616

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

1921
/**
2022
The color of the area inside the border.

0 commit comments

Comments
 (0)