textfield delegate object fix

This commit is contained in:
Pfeil, Scott Robert 2019-04-15 14:39:37 -04:00
parent 01c5abc027
commit e2e6cbabf6

View File

@ -116,7 +116,7 @@
+ (nullable instancetype)mfTextFieldWithMap:(nullable NSDictionary *)map bothDelegates:(nullable id<UITextFieldDelegate, MFTextFieldDelegate>)delegate {
MFTextField *textField = [self mfTextField];
textField.translatesAutoresizingMaskIntoConstraints = NO;
[textField setWithJSON:map delegate:delegate additionalData:nil];
[textField setWithJSON:map delegateObject:[MVMCoreUIDelegateObject createWithDelegateForAll:delegate] additionalData:nil];
return textField;
}
@ -558,10 +558,12 @@
self.isMolecule = YES;
}
- (void)setWithJSON:(NSDictionary *)json delegate:(nullable id<UITextFieldDelegate, MFTextFieldDelegate>)delegate additionalData:(NSDictionary *)additionalData {
[FormValidator setupValidationWithMolecule:self delegate:(id<FormValidationProtocol>)delegate];
FormValidator *formValidator = [FormValidator getFormValidatorForDelegate:(id<FormValidationProtocol>)delegate];
[self setWithMap:json bothDelegates:formValidator];
- (void)setWithJSON:(NSDictionary *)json delegateObject:(DelegateObject *)delegateObject additionalData:(NSDictionary *)additionalData {
if ([delegateObject isKindOfClass:[MVMCoreUIDelegateObject class]]) {
[FormValidator setupValidationWithMolecule:self delegate:((MVMCoreUIDelegateObject *)delegateObject).formValidationProtocol];
FormValidator *formValidator = [FormValidator getFormValidatorForDelegate:((MVMCoreUIDelegateObject *)delegateObject).formValidationProtocol];
[self setWithMap:json bothDelegates:formValidator];
}
}
#pragma mark - FormValidationProtocol