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