FullNameRule

public class FullNameRule : Rule

FullNameRule is a subclass of Rule that defines how a full name is validated.

  • Initializes a FullNameRule object that is used to verify that text in text field is a full name.

    Declaration

    Swift

    public init(message : String = "Please provide a first & last name")

    Parameters

    message

    String of error message.

    Return Value

    An initialized FullNameRule object, or nil if an object could not be created for some reason that would not result in an exception.

  • Used to validate a text field.

    Declaration

    Swift

    public func validate(value: String) -> Bool

    Parameters

    value

    String to checked for validation.

    Return Value

    A boolean value. True if validation is successful; False if validation fails.

  • Used to display error message of a text field that has failed validation.

    Declaration

    Swift

    public func errorMessage() -> String

    Return Value

    String of error message.