SurveyValidator Class Reference
| Inherits from | NSObject |
| Declared in | SurveyValidator.h |
Tasks
Uses defined validation to validate given values.
-
– registerValidation:withBlock:Registers validation block methods with a given name.
-
– resetValidatorsToDefaultResets all registered validators back to Survey’s default validators.
-
– validateString:withValidator:Returns a YES/NO if string value validates against validator with provided name.
-
+ instanceReturns an instance of the SurveyValidator
-
+ registerValidation:withBlock:Shortcut method to register validators
-
+ validateString:withValidator:Shortcut method to validate provided string.
Class Methods
instance
Returns an instance of the SurveyValidator
+ (instancetype)instanceReturn Value
an instance of the SurveyValidator
Discussion
Returns an instance of the SurveyValidator
Declared In
SurveyValidator.hregisterValidation:withBlock:
Shortcut method to register validators
+ (void)registerValidation:(NSString *)validationName withBlock:(SurveyValidationBlock)blockParameters
- validationName
Name for the validation block
- block
Callback used to validate given value.
Discussion
Shortcut method to register validators
Declared In
SurveyValidator.hvalidateString:withValidator:
Shortcut method to validate provided string.
+ (BOOL)validateString:(NSString *)value withValidator:(NSString *)validatorNameParameters
- value
String to validate
- validatorName
Validator to use to validate value.
Return Value
a YES/NO if string value validates against validator with provided name.
Discussion
Shortcut method to validate provided string.
Declared In
SurveyValidator.hInstance Methods
registerValidation:withBlock:
Registers validation block methods with a given name.
- (void)registerValidation:(NSString *)validationName withBlock:(SurveyValidationBlock)blockParameters
- validationName
Name for the validation block
- block
Callback used to validate given value.
Discussion
Registers validation block methods with a given name.
@discussion The block passes the value of the field to the provided block which will return a true or false response, validationName can be anything, see SurveyDefines.h for predefined validators.
Declared In
SurveyValidator.hresetValidatorsToDefault
Resets all registered validators back to Survey’s default validators.
- (void)resetValidatorsToDefaultDiscussion
Resets all registered validators back to Survey’s default validators.
Declared In
SurveyValidator.hvalidateString:withValidator:
Returns a YES/NO if string value validates against validator with provided name.
- (BOOL)validateString:(NSString *)value withValidator:(NSString *)validatorNameParameters
- value
String to validate
- validatorName
Validator to use to validate value.
Return Value
a YES/NO if string value validates against validator with provided name.
Discussion
Returns a YES/NO if string value validates against validator with provided name.
Declared In
SurveyValidator.h