RBManagedFormValidationRuleSchema Class Reference

Inherits from NSObject
Conforms to NSCopying
Declared in RBManagedFormValidationRuleSchema.h

Overview

A managed form field validation rule schema.

  type

The type of validation rule.

@property (nonatomic) RBManagedFormValidationRuleType type

Declared In

RBManagedFormValidationRuleSchema.h

  failureMessage

The failure message to use when the field is invalid.

@property (nonatomic, nullable) NSString *failureMessage

Declared In

RBManagedFormValidationRuleSchema.h

  data

The validation context data.

@property (nonatomic, nullable) id data

Declared In

RBManagedFormValidationRuleSchema.h

– initWithSchemaDictionary:

Initializes a new managed form field validation rule schema with the given serialised dictionary schema.

- (nonnull instancetype)initWithSchemaDictionary:(nonnull NSDictionary *)schemaDictionary

Parameters

schemaDictionary

The serialised dictionary schema.

Return Value

The initialized schema object.

Declared In

RBManagedFormValidationRuleSchema.h

– schemaDictionary

Serialises the managed form field validation rule schema to a dictionary.

- (nonnull NSDictionary *)schemaDictionary

Return Value

The serialised schema dictionary.

Declared In

RBManagedFormValidationRuleSchema.h

– newValidationRule

Creates a new RBManagedFormValidationRule object from the schema.

- (nullable RBManagedFormValidationRule *)newValidationRule

Return Value

The new RBManagedFormValidationRule object.

Declared In

RBManagedFormValidationRuleSchema.h

+ nonEmptyRuleWithFailureMessage:

Creates a new validation rule schema that the field cannot be empty.

+ (nonnull instancetype)nonEmptyRuleWithFailureMessage:(nonnull NSString *)failureMessage

Parameters

failureMessage

The failure message to use when the field is invalid.

Return Value

The new validation rule.

Declared In

RBManagedFormValidationRuleSchema.h

+ ruleWithRegularExpression:failureMessage:

Creates a new validation rule schema that applies a regular expression to the field value.

+ (nonnull instancetype)ruleWithRegularExpression:(nonnull NSString *)regularExpression failureMessage:(nonnull NSString *)failureMessage

Parameters

regularExpression

The regular expression to match on the field value.

failureMessage

The failure message to use when the field is invalid.

Return Value

The new validation rule.

Declared In

RBManagedFormValidationRuleSchema.h

+ ruleWithNumericRangeFrom:to:failureMessage:

Creates a new validation rule schema that ensures a numeric field has a value in the given range.

+ (nonnull instancetype)ruleWithNumericRangeFrom:(double)minimumValue to:(double)maximumValue failureMessage:(nonnull NSString *)failureMessage

Parameters

minimumValue

The minimum value.

maximumValue

The maximum value.

failureMessage

The failure message to use when the field is invalid.

Return Value

The new validation rule.

Declared In

RBManagedFormValidationRuleSchema.h

+ ruleWithNumericMinimumValue:failureMessage:

Creates a new validation rule schema that ensures a numeric field has a minimum value.

+ (nonnull instancetype)ruleWithNumericMinimumValue:(double)minimumValue failureMessage:(nonnull NSString *)failureMessage

Parameters

minimumValue

The minimum value.

failureMessage

The failure message to use when the field is invalid.

Return Value

The new validation rule.

Declared In

RBManagedFormValidationRuleSchema.h

+ ruleWithNumericMaximumValue:failureMessage:

Creates a new validation rule schema that ensures a numeric field has a maximum value.

+ (nonnull instancetype)ruleWithNumericMaximumValue:(double)maximumValue failureMessage:(nonnull NSString *)failureMessage

Parameters

maximumValue

The maximum value.

failureMessage

The failure message to use when the field is invalid.

Return Value

The new validation rule.

Declared In

RBManagedFormValidationRuleSchema.h

+ ruleWithImageSizeRangeFrom:to:failureMessage:

Creates a new validation rule schema that enforces an image size range.

+ (nonnull instancetype)ruleWithImageSizeRangeFrom:(CGSize)minimumSize to:(CGSize)maximumSize failureMessage:(nonnull NSString *)failureMessage

Parameters

minimumSize

The minimum image size.

maximumSize

The maximum image size.

failureMessage

The failure message to use when the field is invalid.

Return Value

The new validation rule.

Declared In

RBManagedFormValidationRuleSchema.h

+ ruleWithImageMinimumSize:failureMessage:

Creates a new validation rule schema that enforces a minimum image size.

+ (nonnull instancetype)ruleWithImageMinimumSize:(CGSize)minimumSize failureMessage:(nonnull NSString *)failureMessage

Parameters

minimumSize

The minimum image size.

failureMessage

The failure message to use when the field is invalid.

Return Value

The new validation rule.

Declared In

RBManagedFormValidationRuleSchema.h

+ ruleWithImageMaximumSize:failureMessage:

Creates a new validation rule schema that enforces a maximum image size.

+ (nonnull instancetype)ruleWithImageMaximumSize:(CGSize)maximumSize failureMessage:(nonnull NSString *)failureMessage

Parameters

maximumSize

The maximum image size.

failureMessage

The failure message to use when the field is invalid.

Return Value

The new validation rule.

Declared In

RBManagedFormValidationRuleSchema.h

+ ruleWithImageAspectRatio:failureMessage:

Creates a new validation rule schema that enforces an image aspect ratio.

+ (nonnull instancetype)ruleWithImageAspectRatio:(double)aspectRatio failureMessage:(nonnull NSString *)failureMessage

Parameters

aspectRatio

The aspect ratio required of the image.

failureMessage

The failure message to use when the field is invalid.

Return Value

The new validation rule.

Declared In

RBManagedFormValidationRuleSchema.h

+ ruleWithStringLengthRangeFrom:to:failureMessage:

Creates a new validation rule schema that enforces a string length range.

+ (nonnull instancetype)ruleWithStringLengthRangeFrom:(NSUInteger)minimumLength to:(NSUInteger)maximumLength failureMessage:(nonnull NSString *)failureMessage

Parameters

minimumLength

The minimum string length.

maximumLength

The maximum string length.

failureMessage

The failure message to use when the field is invalid.

Return Value

The new validation rule.

Declared In

RBManagedFormValidationRuleSchema.h

+ ruleWithStringLengthMinimumLength:failureMessage:

Creates a new validation rule schema that enforces a minimum string length

+ (nonnull instancetype)ruleWithStringLengthMinimumLength:(NSUInteger)minimumLength failureMessage:(nonnull NSString *)failureMessage

Parameters

minimumLength

The minimum string length.

failureMessage

The failure message to use when the field is invalid.

Return Value

The new validation rule.

Declared In

RBManagedFormValidationRuleSchema.h

+ ruleWithStringLengthMaximumLength:failureMessage:

Creates a new validation rule schema that enforces a maximum string length

+ (nonnull instancetype)ruleWithStringLengthMaximumLength:(NSUInteger)maximumLength failureMessage:(nonnull NSString *)failureMessage

Parameters

maximumLength

The maximum string length.

failureMessage

The failure message to use when the field is invalid.

Return Value

The new validation rule.

Declared In

RBManagedFormValidationRuleSchema.h

+ ruleWithArrayCountRangeFrom:to:failureMessage:

Creates a new validation rule schema that enforces an array count range.

+ (nonnull instancetype)ruleWithArrayCountRangeFrom:(NSUInteger)minimumCount to:(NSUInteger)maximumCount failureMessage:(nonnull NSString *)failureMessage

Parameters

minimumCount

The minimum number of elements.

maximumCount

The maximum number of elements.

failureMessage

The failure message to use when the field is invalid.

Return Value

The new validation rule.

Declared In

RBManagedFormValidationRuleSchema.h

+ ruleWithArrayCountMinimum:failureMessage:

Creates a new validation rule schema that enforces a minimum array count.

+ (nonnull instancetype)ruleWithArrayCountMinimum:(NSUInteger)minimumCount failureMessage:(nonnull NSString *)failureMessage

Parameters

minimumCount

The minimum number of elements.

failureMessage

The failure message to use when the field is invalid.

Return Value

The new validation rule.

Declared In

RBManagedFormValidationRuleSchema.h

+ ruleWithArrayCountMaximum:failureMessage:

Creates a new validation rule schema that enforces a maximum array count.

+ (nonnull instancetype)ruleWithArrayCountMaximum:(NSUInteger)maximumCount failureMessage:(nonnull NSString *)failureMessage

Parameters

maximumCount

The maximum number of elements.

failureMessage

The failure message to use when the field is invalid.

Return Value

The new validation rule.

Declared In

RBManagedFormValidationRuleSchema.h