-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathMFTextField.h
More file actions
91 lines (74 loc) · 2.57 KB
/
Copy pathMFTextField.h
File metadata and controls
91 lines (74 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
//
// MFTextField.h
// MaterialTextField
//
// Created by Steph Sharp on 21/07/2015.
// Copyright (c) 2015 Stephanie Sharp. All rights reserved.
//
#import <UIKit/UIKit.h>
IB_DESIGNABLE
@interface MFTextField : UITextField
/**
* textPadding.height: Padding above and below the text field, between the placeholder label and underline.
* textPadding.width: Horizontal padding on the left and right of the text field.
*/
@property (nonatomic) IBInspectable CGSize textPadding;
/**
* Animate placeholder label above text field on focus or input (see placeholderAnimatesOnFocus).
* Default is YES.
*/
@property (nonatomic) IBInspectable BOOL animatesPlaceholder;
/**
* Default is NO. If YES, the placeholder label will animate up on focus rather than on text input.
*/
@property (nonatomic) IBInspectable BOOL placeholderAnimatesOnFocus;
/**
* The color of the text field's default placeholder (displayed when text field is empty).
*/
@property (nonatomic) IBInspectable UIColor *defaultPlaceholderColor;
/**
* The color of the placeholder label when the text field is not in focus.
*/
@property (nonatomic) IBInspectable UIColor *placeholderColor;
/**
* Defaults to the first applicable font:
* - the attributed placeholder font at the default placeholder size
* - the text field font at the default placeholder size
*/
@property (nonatomic) UIFont *placeholderFont;
/**
* The height of the underline when the text field is not in focus.
*/
@property (nonatomic) IBInspectable CGFloat underlineHeight;
/**
* The height of the underline when the text field is in focus.
*/
@property (nonatomic) IBInspectable CGFloat underlineEditingHeight;
/**
* The color of the underline when the text field is not in focus.
*/
@property (nonatomic) IBInspectable UIColor *underlineColor;
/**
* To display an error under the text field, provide an NSError with a localized description.
*
* @param animated Set to YES to animate showing & hiding the error message.
*/
- (void)setError:(NSError *)error animated:(BOOL)animated;
/**
* The error displayed under the text field.
*/
@property (nonatomic, readonly) NSError *error;
/**
* The font for the error displayed under the text field.
*/
@property (nonatomic) UIFont *errorFont;
/**
* The color of the error displayed under the text field.
*/
@property (nonatomic) IBInspectable UIColor *errorColor;
/**
* errorPadding.height: The vertical padding between the underline and the error label.
* errorPadding.width: Horizontal padding on the left and right of the error label.
*/
@property (nonatomic) IBInspectable CGSize errorPadding;
@end