BasicValidatable
public class BasicValidatable<V> : NamedValidatable
Represents all components required for single basic validation to perform.
-
Initializes a
Validatableobject.Declaration
Swift
public init(name: String, value: V?, rules: [ValidationRule<V>])Parameters
nameString that used to identify.
valueValue to be validate. It could be any type as long as rules support it.
rulesArray of validation rules.
messageError message string.
Return Value
An initialized object.
-
Validate.
Declaration
Swift
public func validate() -> ValidationError?Return Value
ValidationErrorif fails otherwise nil. -
Name of the validatable
Declaration
Swift
public var description: String { get }
View on GitHub
BasicValidatable Class Reference