From 0abefbcdc00ad1ee90a678361d4590ca18dac3d1 Mon Sep 17 00:00:00 2001 From: "Suresh, Kamlesh" Date: Wed, 17 Apr 2019 11:40:44 -0400 Subject: [PATCH] using MVMCoreUIDelegateObject --- MVMCoreUI/Atoms/Views/MVMCoreUICheckBox.h | 2 -- MVMCoreUI/Atoms/Views/MVMCoreUICheckBox.m | 11 ++++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/MVMCoreUI/Atoms/Views/MVMCoreUICheckBox.h b/MVMCoreUI/Atoms/Views/MVMCoreUICheckBox.h index 831c1994..853293c7 100644 --- a/MVMCoreUI/Atoms/Views/MVMCoreUICheckBox.h +++ b/MVMCoreUI/Atoms/Views/MVMCoreUICheckBox.h @@ -59,6 +59,4 @@ - (void)setValueForAccessibilityText:(nullable NSString *)text; - (void)hideDescriptionLabelAndPinCheckboxToRight; -- (void)setWithJSON:(nullable NSDictionary *)json delegate:(nullable NSObject *)delegate additionalData:(nullable NSDictionary *)additionalData; - @end diff --git a/MVMCoreUI/Atoms/Views/MVMCoreUICheckBox.m b/MVMCoreUI/Atoms/Views/MVMCoreUICheckBox.m index fb81e0b5..00415b71 100644 --- a/MVMCoreUI/Atoms/Views/MVMCoreUICheckBox.m +++ b/MVMCoreUI/Atoms/Views/MVMCoreUICheckBox.m @@ -43,7 +43,7 @@ static const CGFloat CheckBoxHeightWidth = 18.0; @property (nonatomic) BOOL isRequired; @property (nullable, strong, nonatomic) NSString *fieldKey; -@property (nullable, weak) id delegate; +@property (nullable, weak) DelegateObject *delegate; @end @@ -51,9 +51,10 @@ static const CGFloat CheckBoxHeightWidth = 18.0; #pragma mark - convenient class methods -- (void)setWithJSON:(nullable NSDictionary *)json delegate:(nullable NSObject *)delegate additionalData:(nullable NSDictionary *)additionalData { - [FormValidator setupValidationWithMolecule:self delegate:(id)delegate]; - self.delegate = (id)delegate; +- (void)setWithJSON:(NSDictionary *)json delegateObject:(DelegateObject *)delegateObject additionalData:(NSDictionary *)additionalData { + + [FormValidator setupValidationWithMolecule:self delegate:((MVMCoreUIDelegateObject *)delegateObject).formValidationProtocol]; + self.delegate = delegateObject; self.fieldKey = [json stringForKey:KeyFieldKey]; self.isRequired = [json boolForKey:KeyRequired]; @@ -312,7 +313,7 @@ static const CGFloat CheckBoxHeightWidth = 18.0; [self.checkMark updateCheckSelected:NO animated:animated]; } - FormValidator *formValidator = [FormValidator getFormValidatorForDelegate:self.delegate]; + FormValidator *formValidator = [FormValidator getFormValidatorForDelegate:((MVMCoreUIDelegateObject *)self.delegate).formValidationProtocol]; [formValidator enableByValidation]; }