Index

RBFormValidator.h

Classes


RBFormValidator

A validator for an RBFormView object.

Properties

The result (NSNumber boolean) of each form field by it's name.
public results [String : NSNumber] { get }

The error messages for each field that failed validation.
public messages [String : String] { get }

The last form values that were validated.
public lastValues NSDictionary { get }

Whether or not the last set of form values processed were valid.
public formIsValid Bool { get }

Functions

Add a validation rule to the validator.
@param rule : The validation rule to add.
@param identifier : The name of the identifier that this rule validates.
- (void)addRule:(nonnull RBFormValidationRule *)rule toFieldWithIdentifier:(nonnull NSString *)identifier;

Remove all of the validation rules for the given field name.
@param identifier : The identifier of the field.
- (void)removeAllRulesForFieldWithIdentifier:(nonnull NSString *)identifier;

Validate the given set of form values.
@param values : The form values to validate.
@param formView : The form view.
- (void)validateFormWithValues:(nonnull NSDictionary *)values formView:(nullable RBFormView *)formView;

Validate the given form field with a value.
@param identifier : The identifier of the field.
@param value : The current value of the field.
@param formView : The form view.
@returns Whether or not the field value was valid.
- (BOOL)validateFormFieldWithIdentifier:(nonnull NSString *)identifier value:(nullable id)value formView:(nullable RBFormView *)formView;

Whether or not the named field validated in the last set of values.
@param identifier : The identifier of the field.
@returns Whether the field was valid.
- (BOOL)fieldIsValid:(nonnull NSString *)identifier;