Skip to content

Commit d615c74

Browse files
author
Stephanie Sharp
committed
Add code comments to document MFTextField properties
1 parent 9e42123 commit d615c74

1 file changed

Lines changed: 33 additions & 4 deletions

File tree

MaterialTextField/MFTextField.h

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,44 +11,73 @@
1111
IB_DESIGNABLE
1212
@interface MFTextField : UITextField
1313

14+
/**
15+
* textPadding.height: Padding above and below the text field, between the placeholder label and underline.
16+
* textPadding.width: Horizontal padding is yet to be implemented.
17+
*/
1418
@property (nonatomic) IBInspectable CGSize textPadding;
1519

20+
/**
21+
* Animate placeholder label above text field on focus or input (see placeholderAnimatesOnFocus).
22+
* Default is YES.
23+
*/
1624
@property (nonatomic) IBInspectable BOOL animatesPlaceholder;
1725

1826
/**
19-
* Defaults to NO. If set to YES, placeholder will animate up on focus instead of on text input.
27+
* Default is NO. If YES, the placeholder label will animate up on focus rather than on text input.
2028
*/
2129
@property (nonatomic) IBInspectable BOOL placeholderAnimatesOnFocus;
2230

2331
/**
24-
* Optional property to set the color of the textfield's default placeholder
32+
* The color of the text field's default placeholder (displayed when text field is empty).
2533
*/
2634
@property (nonatomic) IBInspectable UIColor *defaultPlaceholderColor;
2735

36+
/**
37+
* The color of the placeholder label when the text field is not in focus.
38+
*/
2839
@property (nonatomic) IBInspectable UIColor *placeholderColor;
2940

3041
/**
3142
* Defaults to the first applicable font:
3243
* - the attributed placeholder font at the default placeholder size
33-
* - the textField font at the default placeholder size
44+
* - the text field font at the default placeholder size
3445
*/
3546
@property (nonatomic) UIFont *placeholderFont;
3647

48+
/**
49+
* The height of the underline when the text field is not in focus.
50+
*/
3751
@property (nonatomic) IBInspectable CGFloat underlineHeight;
3852

53+
/**
54+
* The height of the underline when the text field is in focus.
55+
*/
3956
@property (nonatomic) IBInspectable CGFloat underlineEditingHeight;
4057

58+
/**
59+
* The color of the underline when the text field is not in focus.
60+
*/
4161
@property (nonatomic) IBInspectable UIColor *underlineColor;
4262

4363
/**
44-
* The error message displayed under the text field is the NSError's localized description.
64+
* To display an error under the text field, provide an NSError with a localized description.
4565
*/
4666
@property (nonatomic) NSError *error;
4767

68+
/**
69+
* The font for the error displayed under the text field.
70+
*/
4871
@property (nonatomic) UIFont *errorFont;
4972

73+
/**
74+
* The color of the error displayed under the text field.
75+
*/
5076
@property (nonatomic) IBInspectable UIColor *errorColor;
5177

78+
/**
79+
* The vertical padding between the underline and the error label.
80+
*/
5281
@property (nonatomic) IBInspectable CGFloat errorPadding;
5382

5483
@end

0 commit comments

Comments
 (0)