Skip to content

Commit a29eb2c

Browse files
andrewovertonmaterial-automation
authored andcommitted
[TextFields] Deprecate MDCTextField and its associated classes/protocols
PiperOrigin-RevId: 360449716
1 parent b64b0ec commit a29eb2c

20 files changed

+68
-24
lines changed

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.

components/TextFields/src/MDCTextInputCharacterCounter.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
of context), this object can instead choose to do sophisticated counting (ie: ignoring whitespace,
2424
ignoring url strings, ignoring usernames, etc).
2525
*/
26-
@protocol MDCTextInputCharacterCounter <NSObject>
26+
__deprecated_msg(
27+
"MDCTextField and its associated classes are deprecated. Please use TextControls instead.")
28+
@protocol MDCTextInputCharacterCounter<NSObject>
2729

2830
/**
2931
Returns the count of characters for the text field.
@@ -41,6 +43,8 @@
4143
4244
MDCTextInputAllCharactersCounter is naive (counts each character regardless of context).
4345
*/
44-
@interface MDCTextInputAllCharactersCounter : NSObject <MDCTextInputCharacterCounter>
46+
__deprecated_msg(
47+
"MDCTextField and its associated classes are deprecated. Please use TextControls instead.")
48+
@interface MDCTextInputAllCharactersCounter : NSObject<MDCTextInputCharacterCounter>
4549

4650
@end

components/TextFields/src/MDCTextInputController.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
@protocol MDCTextInputCharacterCounter;
2121

2222
/** Controllers that manipulate styling and animation of text inputs. */
23-
@protocol MDCTextInputController <NSObject, NSCopying, MDCTextInputPositioningDelegate>
23+
__deprecated_msg(
24+
"MDCTextField and its associated classes are deprecated. Please use TextControls instead.")
25+
@protocol MDCTextInputController<NSObject, NSCopying, MDCTextInputPositioningDelegate>
2426

2527
/**
2628
Color for decorations that indicates the input is currently editing.

0 commit comments

Comments
 (0)