|
11 | 11 | IB_DESIGNABLE |
12 | 12 | @interface MFTextField : UITextField |
13 | 13 |
|
| 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 | + */ |
14 | 18 | @property (nonatomic) IBInspectable CGSize textPadding; |
15 | 19 |
|
| 20 | +/** |
| 21 | + * Animate placeholder label above text field on focus or input (see placeholderAnimatesOnFocus). |
| 22 | + * Default is YES. |
| 23 | + */ |
16 | 24 | @property (nonatomic) IBInspectable BOOL animatesPlaceholder; |
17 | 25 |
|
18 | 26 | /** |
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. |
20 | 28 | */ |
21 | 29 | @property (nonatomic) IBInspectable BOOL placeholderAnimatesOnFocus; |
22 | 30 |
|
23 | 31 | /** |
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). |
25 | 33 | */ |
26 | 34 | @property (nonatomic) IBInspectable UIColor *defaultPlaceholderColor; |
27 | 35 |
|
| 36 | +/** |
| 37 | + * The color of the placeholder label when the text field is not in focus. |
| 38 | + */ |
28 | 39 | @property (nonatomic) IBInspectable UIColor *placeholderColor; |
29 | 40 |
|
30 | 41 | /** |
31 | 42 | * Defaults to the first applicable font: |
32 | 43 | * - 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 |
34 | 45 | */ |
35 | 46 | @property (nonatomic) UIFont *placeholderFont; |
36 | 47 |
|
| 48 | +/** |
| 49 | + * The height of the underline when the text field is not in focus. |
| 50 | + */ |
37 | 51 | @property (nonatomic) IBInspectable CGFloat underlineHeight; |
38 | 52 |
|
| 53 | +/** |
| 54 | + * The height of the underline when the text field is in focus. |
| 55 | + */ |
39 | 56 | @property (nonatomic) IBInspectable CGFloat underlineEditingHeight; |
40 | 57 |
|
| 58 | +/** |
| 59 | + * The color of the underline when the text field is not in focus. |
| 60 | + */ |
41 | 61 | @property (nonatomic) IBInspectable UIColor *underlineColor; |
42 | 62 |
|
43 | 63 | /** |
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. |
45 | 65 | */ |
46 | 66 | @property (nonatomic) NSError *error; |
47 | 67 |
|
| 68 | +/** |
| 69 | + * The font for the error displayed under the text field. |
| 70 | + */ |
48 | 71 | @property (nonatomic) UIFont *errorFont; |
49 | 72 |
|
| 73 | +/** |
| 74 | + * The color of the error displayed under the text field. |
| 75 | + */ |
50 | 76 | @property (nonatomic) IBInspectable UIColor *errorColor; |
51 | 77 |
|
| 78 | +/** |
| 79 | + * The vertical padding between the underline and the error label. |
| 80 | + */ |
52 | 81 | @property (nonatomic) IBInspectable CGFloat errorPadding; |
53 | 82 |
|
54 | 83 | @end |
0 commit comments