-
Notifications
You must be signed in to change notification settings - Fork 0
/
UITextField+kvi_Validation.h
executable file
·54 lines (33 loc) · 1.9 KB
/
UITextField+kvi_Validation.h
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
//
// UITextField+kvi_Validation.h
// TenInstitute
//
// Created by Vasyl Khmil on 11/13/15.
// Copyright © 2015 com.n-ix. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UITextField (kvi_Validation)
@property (nonatomic, strong, nullable) IBInspectable NSString *validationRegex;
@property (nonatomic, strong, nullable) IBInspectable UIColor *invalidStateColor;
@property (nonatomic, strong, nullable) IBInspectable UIColor *validStateColor;
@property (nonatomic) IBInspectable NSUInteger minimalNumberOfCharacters;
@property (nonatomic) IBInspectable NSUInteger maximalNumberOfCharacters;
@property (nonatomic) IBInspectable BOOL showErrorMessage;
@property (nonatomic) IBInspectable BOOL showErrorImage;
@property (nonatomic) CGFloat borderWidth;
@property (nonatomic, strong, nullable) IBInspectable NSString *errorMessage;
@property (nonatomic, strong, nullable) IBOutlet UILabel *errorMessageLabel;
@property (nonatomic, strong, nullable) IBOutlet UIImageView *errorImageView;
@property (nonatomic, strong, nullable) IBOutlet UITextField *equalContentTextField;
@property (nonatomic, readonly) BOOL isValid;
- (BOOL)checkIfIsValidAndUpdateValidationState;
+ (void)checkAllVisibleFieldsIfIsValidWithMatchedFields:(NSArray *__autoreleasing _Nullable * _Nullable)matchedFields
faildedFields:(NSArray *__autoreleasing _Nullable * _Nullable)failedFields
updateStates:(BOOL)updateStates;
+ (void)checkAllFieldsIfIsValidOnView:(nonnull UIView *)view
withMatchedFields:(NSArray *__autoreleasing _Nullable * _Nullable)matchedFields
faildedFields:(NSArray *__autoreleasing _Nullable * _Nullable)failedFields
updateStates:(BOOL)updateStates;
- (void)updateState:(BOOL)isValid;
- (void)updateState:(BOOL)isValid withErrorMessage:(NSString*)errorMessage;
@end