Compare commits
14 Commits
master
...
remote-val
| Author | SHA1 | Date |
|---|---|---|
|
|
b9b9a65b74 | |
|
|
7bc7067515 | |
|
|
87a47a3107 | |
|
|
f9fad02c3d | |
|
|
0bd79451d2 | |
|
|
0d2b50c9a6 | |
|
|
d4aa8e594f | |
|
|
d359bf0683 | |
|
|
b57e924b26 | |
|
|
7c6bf284c4 | |
|
|
3f5fb305c3 | |
|
|
3a7d4956b9 | |
|
|
cb94d71119 | |
|
|
3bab916c05 |
21
.travis.yml
21
.travis.yml
|
|
@ -1,24 +1,15 @@
|
|||
language: objective-c
|
||||
osx_image: xcode8
|
||||
xcode_sdk: iphonesimulator10.0
|
||||
xcode_project: Validator.xcodeproj
|
||||
xcode_scheme: Validator
|
||||
osx_image: xcode7.1
|
||||
|
||||
before_install:
|
||||
- gem install cocoapods -v '0.32.1'
|
||||
|
||||
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
|
||||
|
||||
script:
|
||||
- xcodebuild clean build test -project Validator.xcodeproj -scheme Validator -sdk iphonesimulator -destination "platform=iOS Simulator,OS=10.0,name=iPhone 6" -enableCodeCoverage YES CODE_SIGNING_REQUIRED=NO | xcpretty
|
||||
|
||||
- pod lib lint
|
||||
- xcodebuild clean build test -project Validator.xcodeproj -scheme Validator -sdk iphonesimulator9.1 -destination "OS=9.1,name=iPhone 6" -enableCodeCoverage YES | xcpretty
|
||||
|
||||
after_success:
|
||||
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
|
||||
|
||||
notifications:
|
||||
webhooks:
|
||||
urls:
|
||||
- https://webhooks.gitter.im/e/4cfa929bd227586305cc
|
||||
on_success: change # options: [always|never|change] default: always
|
||||
on_failure: always # options: [always|never|change] default: always
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
74
README.md
74
README.md
|
|
@ -1,7 +1,6 @@
|
|||
SwiftValidator
|
||||
===============
|
||||
|
||||
[](https://travis-ci.org/SwiftValidatorCommunity/SwiftValidator) [](https://codecov.io/github/SwiftValidatorCommunity/SwiftValidator?branch=master)
|
||||
=======
|
||||
[](https://travis-ci.org/jpotts18/SwiftValidator) [](https://github.com/Carthage/Carthage) [](https://codecov.io/github/jpotts18/SwiftValidator?branch=master)
|
||||
|
||||
Swift Validator is a rule-based validation library for Swift.
|
||||
|
||||
|
|
@ -21,18 +20,7 @@ source 'https://github.com/CocoaPods/Specs.git'
|
|||
platform :ios, "8.1"
|
||||
|
||||
use_frameworks!
|
||||
|
||||
# Swift 3
|
||||
# Extended beyond UITextField
|
||||
pod 'SwiftValidator', :git => 'https://github.com/jpotts18/SwiftValidator.git', :branch => 'master'
|
||||
|
||||
# Swift 2.1
|
||||
# Extended beyond UITextField
|
||||
# Note: Installing 4.x.x will break code from 3.x.x
|
||||
pod 'SwiftValidator', :git => 'https://github.com/jpotts18/SwiftValidator.git', :tag => '4.0.0'
|
||||
|
||||
# Swift 2.1 (limited to UITextField validation)
|
||||
pod 'SwiftValidator', :git => 'https://github.com/jpotts18/SwiftValidator.git', :tag => '3.0.5'
|
||||
pod 'SwiftValidator', '3.0.3'
|
||||
```
|
||||
|
||||
Install into your project:
|
||||
|
|
@ -82,7 +70,7 @@ override func viewDidLoad() {
|
|||
|
||||
// You can now pass in regex and length parameters through overloaded contructors
|
||||
validator.registerField(phoneNumberTextField, errorLabel: phoneNumberErrorLabel, rules: [RequiredRule(), MinLengthRule(length: 9)])
|
||||
validator.registerField(zipcodeTextField, errorLabel: zipcodeErrorLabel, rules: [RequiredRule(), ZipCodeRule(regex : "\\d{5}")])
|
||||
validator.registerField(zipcodeTextField, errorLabel: zipcodeErrorLabel, rules: [RequiredRule(), ZipCodeRule(regex = "\\d{5}")])
|
||||
|
||||
// You can unregister a text field if you no longer want to validate it
|
||||
validator.unregisterField(fullNameTextField)
|
||||
|
|
@ -94,7 +82,7 @@ Validate Fields on button tap or however you would like to trigger it.
|
|||
|
||||
```swift
|
||||
@IBAction func signupTapped(sender: AnyObject) {
|
||||
validator.validate(self)
|
||||
validator.validate(delegate:self)
|
||||
}
|
||||
```
|
||||
|
||||
|
|
@ -107,21 +95,19 @@ func validationSuccessful() {
|
|||
// submit the form
|
||||
}
|
||||
|
||||
func validationFailed(_ errors:[(Validatable ,ValidationError)]) {
|
||||
// turn the fields to red
|
||||
for (field, error) in errors {
|
||||
if let field = field as? UITextField {
|
||||
field.layer.borderColor = UIColor.red.cgColor
|
||||
field.layer.borderWidth = 1.0
|
||||
}
|
||||
error.errorLabel?.text = error.errorMessage // works if you added labels
|
||||
error.errorLabel?.isHidden = false
|
||||
}
|
||||
func validationFailed(errors:[UITextField:ValidationError]) {
|
||||
// turn the fields to red
|
||||
for (field, error) in validator.errors {
|
||||
field.layer.borderColor = UIColor.redColor().CGColor
|
||||
field.layer.borderWidth = 1.0
|
||||
error.errorLabel?.text = error.errorMessage // works if you added labels
|
||||
error.errorLabel?.hidden = false
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Single Field Validation
|
||||
### Single Field Validation
|
||||
|
||||
You may use single field validation in some cases. This could be useful in situations such as controlling responders:
|
||||
|
||||
|
|
@ -140,6 +126,7 @@ func textFieldShouldReturn(textField: UITextField) -> Bool {
|
|||
}
|
||||
```
|
||||
|
||||
|
||||
## Custom Validation
|
||||
|
||||
We will create a ```SSNRule``` class to show how to create your own Validation. A United States Social Security Number (or SSN) is a field that consists of XXX-XX-XXXX.
|
||||
|
|
@ -158,15 +145,37 @@ class SSNVRule: RegexRule {
|
|||
}
|
||||
```
|
||||
|
||||
## Documentation
|
||||
Checkout the docs <a href="http://swiftvalidatorcommunity.github.io/SwiftValidator/">here</a> via [@jazzydocs](https://twitter.com/jazzydocs).
|
||||
## Remote Validation
|
||||
|
||||
Register field to `validator` with `remoteInfo` parameter set
|
||||
|
||||
`validator.registerField(emailTextField, errorLabel: emailErrorLabel, rules: [RequiredRule(), EmailRule()], remoteInfo: (urlString: "http://localhost:8000/emails/", error: "Email already in use"))`
|
||||
|
||||
Implement `ValidationDelegate`'s `remoteValidationRequest` method
|
||||
```swift
|
||||
func remoteValidationRequest(text: String, urlString: String, completion: (result: Bool) -> Void) {
|
||||
// Add email to urlString
|
||||
let newUrlString = "\(urlString)?email=\(text)"
|
||||
YourNetworkingLibrary.request(.GET, newUrlString) { data -> Void in
|
||||
|
||||
if data.httpResponse.statusCode == 404 {
|
||||
// resource was not found, therefore the text (username, email, etc) is available
|
||||
completion(result: true)
|
||||
}
|
||||
|
||||
if data.httpResponse.statusCode == 200 {
|
||||
// resource was found, therefore the text (username, email, etc) is unavailable
|
||||
completion(result: false)
|
||||
}
|
||||
}
|
||||
// end of remoteValidationRequest method
|
||||
}
|
||||
```
|
||||
|
||||
Credits
|
||||
-------
|
||||
|
||||
Swift Validator is written and maintained by Jeff Potter [@jpotts18](http://twitter.com/jpotts18). David Patterson [@dave_tw12](http://twitter.com/dave_tw12) actively works as a collaborator. Special thanks to [Deniz Adalar](https://github.com/dadalar) for
|
||||
adding validation beyond UITextField.
|
||||
Swift Validator is written and maintained by Jeff Potter [@jpotts18](http://twitter.com/jpotts18).
|
||||
|
||||
## Contributing
|
||||
|
||||
|
|
@ -175,4 +184,3 @@ adding validation beyond UITextField.
|
|||
3. Commit your changes `git commit -am 'Add some feature'`
|
||||
4. Push to the branch `git push origin my-new-feature`
|
||||
5. Create a new Pull Request
|
||||
6. Make sure code coverage is at least 70%
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = "SwiftValidator"
|
||||
s.version = "4.0.2"
|
||||
s.version = "3.0.4"
|
||||
s.summary = "A UITextField Validation library for Swift"
|
||||
s.homepage = "https://github.com/TouchInstinct/SwiftValidator"
|
||||
s.homepage = "https://github.com/jpotts18/SwiftValidator"
|
||||
s.screenshots = "https://raw.githubusercontent.com/jpotts18/SwiftValidator/master/swift-validator-v2.gif"
|
||||
s.license = { :type => "MIT", :file => "LICENSE.txt" }
|
||||
s.author = { "Jeff Potter" => "jeff.potter6@gmail.com" }
|
||||
s.social_media_url = "http://twitter.com/jpotts18"
|
||||
s.platform = :ios
|
||||
s.ios.deployment_target = '8.0'
|
||||
s.source = { :git => "https://github.com/TouchInstinct/SwiftValidator.git", :tag => s.version }
|
||||
s.source = { :git => "https://github.com/jpotts18/SwiftValidator.git", :tag => "3.0.4" }
|
||||
s.source_files = "SwiftValidator/**/*.swift"
|
||||
s.exclude_files = "Validator/AppDelegate.swift"
|
||||
s.frameworks = ['Foundation', 'UIKit']
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
//
|
||||
// Validatable.swift
|
||||
// Validator
|
||||
//
|
||||
// Created by Deniz Adalar on 28/04/16.
|
||||
// Copyright © 2016 jpotts18. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public typealias ValidatableField = AnyObject & Validatable
|
||||
|
||||
public protocol Validatable {
|
||||
|
||||
var validationText: String {
|
||||
get
|
||||
}
|
||||
}
|
||||
|
||||
extension UITextField: Validatable {
|
||||
|
||||
public var validationText: String {
|
||||
return text ?? ""
|
||||
}
|
||||
}
|
||||
|
|
@ -11,17 +11,23 @@ import UIKit
|
|||
/**
|
||||
Protocol for `ValidationDelegate` adherents, which comes with two required methods that are called depending on whether validation succeeded or failed.
|
||||
*/
|
||||
public protocol ValidationDelegate {
|
||||
@objc public protocol ValidationDelegate {
|
||||
/**
|
||||
This method will be called on delegate object when validation is successful.
|
||||
|
||||
This delegate method will be called on delegate object when validation is successful.
|
||||
- returns: No return value.
|
||||
*/
|
||||
func validationSuccessful()
|
||||
/**
|
||||
This method will be called on delegate object when validation fails.
|
||||
|
||||
This delegae method will be called on delegate object when validation fails.
|
||||
- returns: No return value.
|
||||
*/
|
||||
func validationFailed(_ errors: [(Validatable, ValidationError)])
|
||||
func validationFailed(errors: [UITextField:ValidationError])
|
||||
/**
|
||||
This delegate method is called on fields that require remote validation.
|
||||
- parameter text: String to is sent to server to be validated.
|
||||
- parameter urlString: String of url endpoint that will be used to validate text.
|
||||
- parameter completion: closure that holds the result of the server validation request. Should be set to true if server validation was a success. Should return false if server validation failed.
|
||||
- returns: No return value.
|
||||
*/
|
||||
optional func remoteValidationRequest(text: String, urlString: String, completion:(result: Bool) -> Void)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,26 +7,36 @@ import Foundation
|
|||
import UIKit
|
||||
|
||||
/**
|
||||
The `ValidationError` class is used for representing errors of a failed validation. It contains the field, error label, and error message of a failed validation.
|
||||
The `ValidationError` class is used for representing errors of a failed validation. It contains the text field, error label, and error message of a failed validation.
|
||||
*/
|
||||
public class ValidationError: NSObject {
|
||||
/// the Validatable field of the field
|
||||
public let field:ValidatableField
|
||||
/// the textField of the field
|
||||
public let textField:UITextField
|
||||
/// the error label of the field
|
||||
public var errorLabel:UILabel?
|
||||
/// the error message of the field
|
||||
public let errorMessage:String
|
||||
|
||||
/**
|
||||
Initializes `ValidationError` object with a field, errorLabel, and errorMessage.
|
||||
|
||||
- parameter field: Validatable field that holds field.
|
||||
Initializes `ValidationError` object with a textField and error.
|
||||
- parameter textField: UITextField that holds textField.
|
||||
- parameter errorMessage: String that holds error message.
|
||||
- returns: An initialized object, or nil if an object could not be created for some reason that would not result in an exception.
|
||||
*/
|
||||
public init(textField:UITextField, error:String){
|
||||
self.textField = textField
|
||||
self.errorMessage = error
|
||||
}
|
||||
|
||||
/**
|
||||
Initializes ValidationError object with a textField, errorLabel, and errorMessage.
|
||||
- parameter textField: UITextField that holds textField.
|
||||
- parameter errorLabel: UILabel that holds error label.
|
||||
- parameter errorMessage: String that holds error message.
|
||||
- returns: An initialized object, or nil if an object could not be created for some reason that would not result in an exception.
|
||||
*/
|
||||
public init(field:ValidatableField, errorLabel:UILabel?, error:String){
|
||||
self.field = field
|
||||
public init(textField:UITextField, errorLabel:UILabel?, error:String){
|
||||
self.textField = textField
|
||||
self.errorLabel = errorLabel
|
||||
self.errorMessage = error
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,19 +11,19 @@ import UIKit
|
|||
/**
|
||||
Class that makes `Validator` objects. Should be added as a parameter to ViewController that will display
|
||||
validation fields.
|
||||
*/
|
||||
*/
|
||||
public class Validator {
|
||||
/// Dictionary to hold all fields (and accompanying rules) that will undergo validation.
|
||||
public var validations = ValidatorDictionary<ValidationRule>()
|
||||
public var validations = [UITextField:ValidationRule]()
|
||||
/// Dictionary to hold fields (and accompanying errors) that were unsuccessfully validated.
|
||||
public var errors = ValidatorDictionary<ValidationError>()
|
||||
/// Dictionary to hold fields by their object identifiers
|
||||
private var fields = ValidatorDictionary<Validatable>()
|
||||
/// Variable that holds success closure to display positive status of field.
|
||||
private var successStyleTransform:((_ validationRule:ValidationRule)->Void)?
|
||||
public var errors = [UITextField:ValidationError]()
|
||||
/// Variable that holds success closure to display positive status of field.
|
||||
public var delegate: ValidationDelegate?
|
||||
private var successStyleTransform:((validationRule:ValidationRule)->Void)?
|
||||
/// Variable that holds error closure to display negative status of field.
|
||||
private var errorStyleTransform:((_ validationError:ValidationError)->Void)?
|
||||
private var errorStyleTransform:((validationError:ValidationError)->Void)?
|
||||
/// - returns: An initialized object, or nil if an object could not be created for some reason that would not result in an exception.
|
||||
private var completedValidationsCount: Int = 0
|
||||
public init(){}
|
||||
|
||||
// MARK: Private functions
|
||||
|
|
@ -31,56 +31,142 @@ public class Validator {
|
|||
/**
|
||||
This method is used to validate all fields registered to Validator. If validation is unsuccessful,
|
||||
field gets added to errors dictionary.
|
||||
|
||||
- returns: No return value.
|
||||
*/
|
||||
private func validateAllFields() {
|
||||
|
||||
errors = ValidatorDictionary<ValidationError>()
|
||||
errors = [:]
|
||||
|
||||
for (_, rule) in validations {
|
||||
for (textField, rule) in validations {
|
||||
if let error = rule.validateField() {
|
||||
errors[rule.field] = error
|
||||
errors[textField] = error
|
||||
|
||||
// let the user transform the field if they want
|
||||
if let transform = self.errorStyleTransform {
|
||||
transform(error)
|
||||
transform(validationError: error)
|
||||
}
|
||||
} else {
|
||||
// No error
|
||||
// let the user transform the field if they want
|
||||
if let transform = self.successStyleTransform {
|
||||
transform(rule)
|
||||
transform(validationRule: rule)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
This method is used to validate all fields registered to Validator. If validation is unsuccessful,
|
||||
field gets added to errors dictionary. Completion closure is used to validator know when all fields
|
||||
have undergone validation attempt.
|
||||
- parameter completion: Bool that is set to true when all fields have experienced validation attempt.
|
||||
- returns: No return value.
|
||||
*/
|
||||
private func validateAllFields(completion: (finished: Bool) -> Void) {
|
||||
errors = [:]
|
||||
|
||||
for (textField, rule) in validations {
|
||||
if rule.remoteInfo != nil {
|
||||
validateRemoteField(textField, callback: { error -> Void in
|
||||
self.completedValidationsCount = self.completedValidationsCount + 1
|
||||
if self.completedValidationsCount == self.validations.count {
|
||||
// Sends validation back to validate()
|
||||
completion(finished: true)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
validateRegularField(textField)
|
||||
self.completedValidationsCount = self.completedValidationsCount + 1
|
||||
if completedValidationsCount == validations.count {
|
||||
// Sends validation back to validate()
|
||||
completion(finished: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
This method is used to validate a field that will need to also be validated via remote request.
|
||||
- parameter textField: TextField of field that is being validated.
|
||||
- parameter completion: Closure that holds the status of textField's validation. Is set to true
|
||||
after remote validation has ended, regardless of whether the validation was a success or failure.
|
||||
- returns: No return value.
|
||||
*/
|
||||
public func validateRemoteField(textField: UITextField, callback: (error: ValidationError?) -> Void) {
|
||||
if let fieldRule = validations[textField] {
|
||||
// Carry on with validation only if regular validation passed
|
||||
if self.validateRegularField(fieldRule.textField) {
|
||||
delegate!.remoteValidationRequest?(textField.text!, urlString: fieldRule.remoteInfo!.urlString, completion: { result -> Void in
|
||||
if result {
|
||||
if let transform = self.successStyleTransform {
|
||||
transform(validationRule: fieldRule)
|
||||
}
|
||||
callback(error: nil)
|
||||
} else {
|
||||
// Stop validation because remote validation failed
|
||||
// Validation Failed on remote call
|
||||
let error = ValidationError(textField: fieldRule.textField, errorLabel: fieldRule.errorLabel, error: fieldRule.remoteInfo!.error)
|
||||
self.errors[fieldRule.textField] = error
|
||||
if let transform = self.errorStyleTransform {
|
||||
transform(validationError: error)
|
||||
}
|
||||
callback(error: error)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Method used to validate a regular field (non-remote).
|
||||
- parameter: TextField of field that is undergoing validation
|
||||
- returns: A Bool that represents whether the validation was a success or failure, returns true for the
|
||||
former and false for the latter.
|
||||
*/
|
||||
private func validateRegularField(textField: UITextField) -> Bool {
|
||||
if let fieldRule = validations[textField] {
|
||||
if let error = fieldRule.validateField() {
|
||||
errors[textField] = error
|
||||
if let transform = self.errorStyleTransform {
|
||||
transform(validationError: error)
|
||||
}
|
||||
return false
|
||||
} else {
|
||||
if let transform = self.successStyleTransform {
|
||||
if fieldRule.remoteInfo == nil {
|
||||
transform(validationRule: fieldRule)
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// MARK: Public functions
|
||||
|
||||
/**
|
||||
This method is used to validate a single field registered to Validator. If validation is unsuccessful,
|
||||
field gets added to errors dictionary.
|
||||
|
||||
- parameter field: Holds validator field data.
|
||||
- parameter textField: Holds validator field data.
|
||||
- returns: No return value.
|
||||
*/
|
||||
public func validateField(_ field: ValidatableField, callback: (_ error:ValidationError?) -> Void){
|
||||
if let fieldRule = validations[field] {
|
||||
public func validateField(textField: UITextField, callback: (error:ValidationError?) -> Void){
|
||||
if let fieldRule = validations[textField] {
|
||||
if let error = fieldRule.validateField() {
|
||||
errors[field] = error
|
||||
errors[textField] = error
|
||||
if let transform = self.errorStyleTransform {
|
||||
transform(error)
|
||||
transform(validationError: error)
|
||||
}
|
||||
callback(error)
|
||||
callback(error: error)
|
||||
} else {
|
||||
if let transform = self.successStyleTransform {
|
||||
transform(fieldRule)
|
||||
transform(validationRule: fieldRule)
|
||||
}
|
||||
callback(nil)
|
||||
callback(error: nil)
|
||||
}
|
||||
} else {
|
||||
callback(nil)
|
||||
callback(error: nil)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -93,62 +179,91 @@ public class Validator {
|
|||
- parameter error: A closure which is called with validationError, an object that holds validation error data
|
||||
- returns: No return value
|
||||
*/
|
||||
public func styleTransformers(success:((_ validationRule:ValidationRule)->Void)?, error:((_ validationError:ValidationError)->Void)?) {
|
||||
public func styleTransformers(success success:((validationRule:ValidationRule)->Void)?, error:((validationError:ValidationError)->Void)?) {
|
||||
self.successStyleTransform = success
|
||||
self.errorStyleTransform = error
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
This method is used to add a field to validator.
|
||||
|
||||
- parameter field: field that is to be validated.
|
||||
- parameter errorLabel: A UILabel that holds error label data
|
||||
- parameter rules: A Rule array that holds different rules that apply to said field.
|
||||
- parameter textField: field that is to be validated.
|
||||
- parameter Rule: An array which holds different rules to validate against textField.
|
||||
- returns: No return value
|
||||
*/
|
||||
public func registerField(_ field: ValidatableField, errorLabel:UILabel? = nil, rules:[Rule]) {
|
||||
validations[field] = ValidationRule(field: field, rules:rules, errorLabel:errorLabel)
|
||||
fields[field] = field
|
||||
*/
|
||||
public func registerField(textField:UITextField, rules:[Rule], remoteInfo: (String, String)? = nil) {
|
||||
validations[textField] = ValidationRule(textField: textField, rules: rules, errorLabel: nil, remoteInfo: remoteInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
This method is used to add a field to validator.
|
||||
|
||||
- parameter textfield: field that is to be validated.
|
||||
- parameter errorLabel: A UILabel that holds error label data
|
||||
- parameter rules: A Rule array that holds different rules that apply to said textField.
|
||||
- returns: No return value
|
||||
*/
|
||||
public func registerField(textField:UITextField, errorLabel:UILabel, rules:[Rule], remoteInfo: (String, String)? = nil) {
|
||||
validations[textField] = ValidationRule(textField: textField, rules:rules, errorLabel:errorLabel, remoteInfo: remoteInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
This method is for removing a field validator.
|
||||
|
||||
- parameter field: field used to locate and remove field from validator.
|
||||
- parameter textField: field used to locate and remove textField from validator.
|
||||
- returns: No return value
|
||||
*/
|
||||
public func unregisterField(_ field:ValidatableField) {
|
||||
validations.removeValueForKey(field)
|
||||
errors.removeValueForKey(field)
|
||||
*/
|
||||
public func unregisterField(textField:UITextField) {
|
||||
validations.removeValueForKey(textField)
|
||||
errors.removeValueForKey(textField)
|
||||
}
|
||||
|
||||
/**
|
||||
This method checks to see if all fields in validator are valid.
|
||||
|
||||
- returns: No return value.
|
||||
*/
|
||||
public func validate(_ delegate:ValidationDelegate) {
|
||||
*/
|
||||
public func validate(delegate:ValidationDelegate) {
|
||||
|
||||
self.validateAllFields()
|
||||
|
||||
if errors.isEmpty {
|
||||
delegate.validationSuccessful()
|
||||
} else {
|
||||
delegate.validationFailed(errors.map { (fields[$1.field]!, $1) })
|
||||
delegate.validationFailed(errors)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
This method validates all fields in validator and sets any errors to errors parameter of callback.
|
||||
This method attempts to validate all fields registered to Validator().
|
||||
- returns: No return value.
|
||||
*/
|
||||
public func validate() {
|
||||
self.validateAllFields { finished -> Void in
|
||||
if self.errors.isEmpty {
|
||||
// call success method if it's implemented
|
||||
self.delegate!.validationSuccessful()
|
||||
} else {
|
||||
// call failure method if it's implemented
|
||||
self.delegate!.validationFailed(self.errors)
|
||||
}
|
||||
// set number of completed validations back to 0
|
||||
self.completedValidationsCount = 0
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
This method validates all fields in validator and sets any errors to errors parameter of closure.
|
||||
|
||||
- parameter callback: A closure which is called with errors, a dictionary of type UITextField:ValidationError.
|
||||
|
||||
- parameter callback: A closure which is called with errors, a dictionary of type Validatable:ValidationError.
|
||||
- returns: No return value.
|
||||
*/
|
||||
public func validate(_ callback:(_ errors:[(Validatable, ValidationError)])->Void) -> Void {
|
||||
*/
|
||||
public func validate(callback:(errors:[UITextField:ValidationError])->Void) -> Void {
|
||||
|
||||
self.validateAllFields()
|
||||
|
||||
callback(errors.map { (fields[$1.field]!, $1) } )
|
||||
callback(errors: errors)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,45 +0,0 @@
|
|||
//
|
||||
// ValidatorDictionary.swift
|
||||
// Validator
|
||||
//
|
||||
// Created by Deniz Adalar on 04/05/16.
|
||||
// Copyright © 2016 jpotts18. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct ValidatorDictionary<T> : Sequence {
|
||||
|
||||
private var innerDictionary: [ObjectIdentifier: T] = [:];
|
||||
|
||||
public subscript(key: ValidatableField?) -> T? {
|
||||
get {
|
||||
if let key = key {
|
||||
return innerDictionary[ObjectIdentifier(key)];
|
||||
} else {
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
set(newValue) {
|
||||
if let key = key {
|
||||
innerDictionary[ObjectIdentifier(key)] = newValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public mutating func removeAll() {
|
||||
innerDictionary.removeAll()
|
||||
}
|
||||
|
||||
public mutating func removeValueForKey(_ key: ValidatableField) {
|
||||
innerDictionary.removeValue(forKey: ObjectIdentifier(key))
|
||||
}
|
||||
|
||||
public var isEmpty: Bool {
|
||||
return innerDictionary.isEmpty
|
||||
}
|
||||
|
||||
public func makeIterator() -> DictionaryIterator<ObjectIdentifier ,T> {
|
||||
return innerDictionary.makeIterator()
|
||||
}
|
||||
}
|
||||
|
|
@ -8,19 +8,8 @@
|
|||
|
||||
import Foundation
|
||||
|
||||
/**
|
||||
`AlphaNumericRule` is a subclass of `CharacterSetRule`. It is used to verify that a field has a
|
||||
valid list of alphanumeric characters.
|
||||
*/
|
||||
public class AlphaNumericRule: CharacterSetRule {
|
||||
|
||||
/**
|
||||
Initializes a `AlphaNumericRule` object to verify that field has valid set of alphanumeric characters.
|
||||
|
||||
- parameter message: String of error message.
|
||||
- returns: An initialized object, or nil if an object could not be created for some reason that would not result in an exception.
|
||||
*/
|
||||
public init(message: String = "Enter valid numeric characters") {
|
||||
super.init(characterSet: CharacterSet.alphanumerics, message: message)
|
||||
super.init(characterSet: NSCharacterSet.alphanumericCharacterSet(), message: message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -8,19 +8,8 @@
|
|||
|
||||
import Foundation
|
||||
|
||||
/**
|
||||
`AlphaRule` is a subclass of `CharacterSetRule`. It is used to verify that a field has a
|
||||
valid list of alpha characters.
|
||||
*/
|
||||
public class AlphaRule: CharacterSetRule {
|
||||
|
||||
/**
|
||||
Initializes an `AlphaRule` object to verify that a field has valid set of alpha characters.
|
||||
|
||||
- parameter message: String of error message.
|
||||
- returns: An initialized object, or nil if an object could not be created for some reason.
|
||||
*/
|
||||
public init(message: String = "Enter valid alphabetic characters") {
|
||||
super.init(characterSet: CharacterSet.letters, message: message)
|
||||
super.init(characterSet: NSCharacterSet.letterCharacterSet(), message: message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -8,48 +8,26 @@
|
|||
|
||||
import Foundation
|
||||
|
||||
/**
|
||||
`CharacterSetRule` is a subclass of `Rule`. It is used to validate IPV4 address fields.
|
||||
*/
|
||||
public class CharacterSetRule: Rule {
|
||||
/// NSCharacter that hold set of valid characters to hold
|
||||
private let characterSet: CharacterSet
|
||||
/// String that holds error message
|
||||
|
||||
private let characterSet: NSCharacterSet
|
||||
private var message: String
|
||||
|
||||
/**
|
||||
Initializes a `CharacterSetRule` object to verify that field has valid set of characters.
|
||||
|
||||
- parameter characterSet: NSCharacterSet that holds group of valid characters.
|
||||
- parameter message: String of error message.
|
||||
- returns: An initialized object, or nil if an object could not be created for some reason that would not result in an exception.
|
||||
*/
|
||||
public init(characterSet: CharacterSet, message: String = "Enter valid alpha") {
|
||||
public init(characterSet: NSCharacterSet, message: String = "Enter valid alpha") {
|
||||
self.characterSet = characterSet
|
||||
self.message = message
|
||||
}
|
||||
|
||||
/**
|
||||
Used to validate field.
|
||||
|
||||
- parameter value: String to checked for validation.
|
||||
- returns: Boolean value. True if validation is successful; False if validation fails.
|
||||
*/
|
||||
public func validate(_ value: String) -> Bool {
|
||||
public func validate(value: String) -> Bool {
|
||||
for uni in value.unicodeScalars {
|
||||
guard let uniVal = UnicodeScalar(uni.value), characterSet.contains(uniVal) else {
|
||||
if !characterSet.longCharacterIsMember(uni.value) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
/**
|
||||
Displays error message when field fails validation.
|
||||
|
||||
- returns: String of error message.
|
||||
*/
|
||||
public func errorMessage() -> String {
|
||||
return message
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -10,35 +10,35 @@ import Foundation
|
|||
import UIKit
|
||||
|
||||
/**
|
||||
`ConfirmationRule` is a subclass of Rule that defines how a field that has to be equal
|
||||
to another field is validated.
|
||||
`ConfirmationRule` is a subclass of Rule that defines how a text field that has to be equal
|
||||
to another text field is validated.
|
||||
*/
|
||||
public class ConfirmationRule: Rule {
|
||||
/// parameter confirmField: field to which original text field will be compared to.
|
||||
private let confirmField: ValidatableField
|
||||
/// parameter confirmField: text field to which original text field will be compared to.
|
||||
private let confirmField: UITextField
|
||||
/// parameter message: String of error message.
|
||||
private var message : String
|
||||
|
||||
/**
|
||||
Initializes a `ConfirmationRule` object to validate the text of a field that should equal the text of another field.
|
||||
Initializes a `ConfirmationRule` object to validate the text of a text field that should equal the text of another text field.
|
||||
|
||||
- parameter confirmField: field to which original field will be compared to.
|
||||
- parameter confirmField: text field to which original text field will be compared to.
|
||||
- parameter message: String of error message.
|
||||
- returns: An initialized object, or nil if an object could not be created for some reason that would not result in an exception.
|
||||
*/
|
||||
public init(confirmField: ValidatableField, message : String = "This field does not match"){
|
||||
public init(confirmField: UITextField, message : String = "This field does not match"){
|
||||
self.confirmField = confirmField
|
||||
self.message = message
|
||||
}
|
||||
|
||||
/**
|
||||
Used to validate a field.
|
||||
Used to validate a text field.
|
||||
|
||||
- parameter value: String to checked for validation.
|
||||
- returns: A boolean value. True if validation is successful; False if validation fails.
|
||||
*/
|
||||
public func validate(_ value: String) -> Bool {
|
||||
return confirmField.validationText == value
|
||||
public func validate(value: String) -> Bool {
|
||||
return confirmField.text == value
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -49,4 +49,4 @@ public class ConfirmationRule: Rule {
|
|||
public func errorMessage() -> String {
|
||||
return message
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -13,10 +13,10 @@ import Foundation
|
|||
public class EmailRule: RegexRule {
|
||||
|
||||
/// Regular express string to be used in validation.
|
||||
static let regex = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"
|
||||
static let regex = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}"
|
||||
|
||||
/**
|
||||
Initializes an `EmailRule` object to validate an email field.
|
||||
Initializes an `EmailRule` object to validate an email text field.
|
||||
|
||||
- parameter message: String of error message.
|
||||
- returns: An initialized object, or nil if an object could not be created for some reason that would not result in an exception.
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
import Foundation
|
||||
|
||||
/**
|
||||
`ExactLengthRule` is a subclass of Rule that is used to make sure a the text of a field is an exact length.
|
||||
`ExactLengthRule` is a subclass of Rule that is used to make sure a the text of a text field is an exact length.
|
||||
*/
|
||||
public class ExactLengthRule : Rule {
|
||||
/// parameter message: String of error message.
|
||||
|
|
@ -18,7 +18,7 @@ public class ExactLengthRule : Rule {
|
|||
private var length : Int
|
||||
|
||||
/**
|
||||
Initializes an `ExactLengthRule` object to validate the text of a field against an exact length.
|
||||
Initializes an `ExactLengthRule` object to validate the text of a text field against an exact length.
|
||||
|
||||
- parameter length: Integer value of exact string length being specified.
|
||||
- parameter message: String of error message.
|
||||
|
|
@ -26,25 +26,25 @@ public class ExactLengthRule : Rule {
|
|||
*/
|
||||
public init(length: Int, message : String = "Must be exactly %ld characters long"){
|
||||
self.length = length
|
||||
self.message = String(format: message, self.length)
|
||||
self.message = NSString(format: message, self.length) as String
|
||||
}
|
||||
|
||||
/**
|
||||
Used to validate a field.
|
||||
Used to validate a text field.
|
||||
|
||||
- parameter value: String to checked for validation.
|
||||
- returns: A boolean value. True if validation is successful; False if validation fails.
|
||||
*/
|
||||
public func validate(_ value: String) -> Bool {
|
||||
return value.count == length
|
||||
public func validate(value: String) -> Bool {
|
||||
return value.characters.count == length
|
||||
}
|
||||
|
||||
/**
|
||||
Displays error message if a field fails validation.
|
||||
Displays error message if a text field fails validation.
|
||||
|
||||
- returns: String of error message.
|
||||
*/
|
||||
public func errorMessage() -> String {
|
||||
return message
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -16,7 +16,7 @@ public class FloatRule:Rule {
|
|||
private var message : String
|
||||
|
||||
/**
|
||||
Initializes a `FloatRule` object to validate that the text of a field is a floating point number.
|
||||
Initializes a `FloatRule` object to validate that the text of a text field is a floating point number.
|
||||
|
||||
- parameter message: String of error message.
|
||||
- returns: An initialized object, or nil if an object could not be created for some reason that would not result in an exception.
|
||||
|
|
@ -26,22 +26,22 @@ public class FloatRule:Rule {
|
|||
}
|
||||
|
||||
/**
|
||||
Used to validate field.
|
||||
Used to validate text field.
|
||||
|
||||
- parameter value: String to checked for validation.
|
||||
- returns: Boolean value. True if validation is successful; False if validation fails.
|
||||
*/
|
||||
public func validate(_ value: String) -> Bool {
|
||||
public func validate(value: String) -> Bool {
|
||||
let regex = try? NSRegularExpression(pattern: "^[-+]?(\\d*[.])?\\d+$", options: [])
|
||||
if let regex = regex {
|
||||
let match = regex.numberOfMatches(in: value, options: [], range: NSRange(location: 0, length: value.count))
|
||||
let match = regex.numberOfMatchesInString(value, options: [], range: NSRange(location: 0, length: value.characters.count))
|
||||
return match == 1
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
Displays error message when field fails validation.
|
||||
Displays error message when text field fails validation.
|
||||
|
||||
- returns: String of error message.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public class FullNameRule : Rule {
|
|||
private var message : String
|
||||
|
||||
/**
|
||||
Initializes a `FullNameRule` object that is used to verify that text in field is a full name.
|
||||
Initializes a `FullNameRule` object that is used to verify that text in text field is a full name.
|
||||
|
||||
- parameter message: String of error message.
|
||||
- returns: An initialized `FullNameRule` object, or nil if an object could not be created for some reason that would not result in an exception.
|
||||
|
|
@ -25,22 +25,22 @@ public class FullNameRule : Rule {
|
|||
}
|
||||
|
||||
/**
|
||||
Used to validate a field.
|
||||
Used to validate a text field.
|
||||
|
||||
- parameter value: String to checked for validation.
|
||||
- returns: A boolean value. True if validation is successful; False if validation fails.
|
||||
*/
|
||||
public func validate(_ value: String) -> Bool {
|
||||
let nameArray: [String] = value.split { $0 == " " }.map { String($0) }
|
||||
public func validate(value: String) -> Bool {
|
||||
let nameArray: [String] = value.characters.split { $0 == " " }.map { String($0) }
|
||||
return nameArray.count >= 2
|
||||
}
|
||||
|
||||
/**
|
||||
Used to display error message of a field that has failed validation.
|
||||
Used to display error message of a text field that has failed validation.
|
||||
|
||||
- returns: String of error message.
|
||||
*/
|
||||
public func errorMessage() -> String {
|
||||
return message
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -8,19 +8,9 @@
|
|||
|
||||
import Foundation
|
||||
|
||||
/**
|
||||
`HexColorRule` is a subclass of `RegexRule`. It is used to verify whether a field is a hexadecimal color.
|
||||
*/
|
||||
public class HexColorRule: RegexRule {
|
||||
/// Regular expression string that is used to verify hexadecimal
|
||||
static let regex = "^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$"
|
||||
|
||||
/**
|
||||
Initializes a `HexaColorRule` object to verify that field has text in hexadecimal color format.
|
||||
|
||||
- parameter message: String of error message.
|
||||
- returns: An initialized object, or nil if an object could not be created for some reason that would not result in an exception.
|
||||
*/
|
||||
public init(message: String = "Invalid regular expression") {
|
||||
super.init(regex: HexColorRule.regex, message: message)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,19 +8,10 @@
|
|||
|
||||
import Foundation
|
||||
|
||||
/**
|
||||
`IPV4Rule` is a subclass of RegexRule that defines how a IPV4 address validated.
|
||||
*/
|
||||
public class IPV4Rule: RegexRule {
|
||||
/// Regular expression string that is used to verify IPV4 address.
|
||||
static let regex = "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"
|
||||
|
||||
/**
|
||||
Initializes a `IPV4Rule` object to verify that field has text is an IPV4Rule address.
|
||||
|
||||
- parameter message: String of error message.
|
||||
- returns: An initialized object, or nil if an object could not be created for some reason that would not result in an exception.
|
||||
*/
|
||||
static let regex = "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"
|
||||
|
||||
public init(message: String = "Must be a valid IPV4 address") {
|
||||
super.init(regex: IPV4Rule.regex, message: message)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,112 +8,46 @@
|
|||
|
||||
import Foundation
|
||||
|
||||
/**
|
||||
`ISBNRule` is a subclass of `Rule`. It is used to verify whether a field is a valid ISBN number.
|
||||
*/
|
||||
public class ISBNRule: Rule {
|
||||
|
||||
/// String that holds error message
|
||||
private let message: String
|
||||
|
||||
/**
|
||||
Initializes a `ISBNRule` object to verify that field has text that is a ISBN number.
|
||||
|
||||
- parameter message: String of error message.
|
||||
- returns: An initialized object, or nil if an object could not be created for some reason that would not result in an exception.
|
||||
*/
|
||||
public init(message: String = "Enter valid ISBN number") {
|
||||
self.message = message
|
||||
}
|
||||
|
||||
/**
|
||||
Method used to validate field.
|
||||
|
||||
- parameter value: String to checked for validation.
|
||||
- returns: Boolean value. True if validation is successful; False if validation fails.
|
||||
*/
|
||||
public func validate(_ value: String) -> Bool {
|
||||
public func validate(value: String) -> Bool {
|
||||
|
||||
guard let regex = try? NSRegularExpression(pattern: "[\\s-]", options: []) else {
|
||||
fatalError("Invalid ISBN sanitizing regex")
|
||||
}
|
||||
|
||||
let sanitized = regex.stringByReplacingMatches(in: value, options: [], range: NSMakeRange(0, value.count), withTemplate: "")
|
||||
let sanitized = regex.stringByReplacingMatchesInString(value, options: [], range: NSMakeRange(0, value.characters.count), withTemplate: "")
|
||||
|
||||
return ISBN10Validator().verify(sanitized) || ISBN13Validator().verify(sanitized)
|
||||
}
|
||||
|
||||
/**
|
||||
Method used to dispaly error message when field fails validation.
|
||||
|
||||
- returns: String of error message.
|
||||
*/
|
||||
public func errorMessage() -> String {
|
||||
return message;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
`ISBNValidator` defines the protocol that objects adopting it must implement.
|
||||
*/
|
||||
private protocol ISBNValidator {
|
||||
/// Regular expression string
|
||||
var regex: String { get }
|
||||
|
||||
/**
|
||||
Method that actually verifies a ISBN number.
|
||||
|
||||
- parameter input: String that is to be validated against `ISBNRule`
|
||||
- returns: A `Bool` that represents what happened during verification. `false` is returned if
|
||||
it fails, `true` is returned if it was a success.
|
||||
*/
|
||||
func verify(_ input: String) -> Bool
|
||||
/**
|
||||
Method that verifies regular expression is valid.
|
||||
|
||||
- parameter input: String that holds ISBN number being validated.
|
||||
- returns: A `Bool` that represents the status of the ISBN number. `false` if ISBN number
|
||||
was not valid, `true` if it was valid.
|
||||
*/
|
||||
func checkRegex(_ input: String) -> Bool
|
||||
|
||||
/**
|
||||
Method that verifies `ISBN` being validated is itself valid. It has to be either ISBN10
|
||||
or ISBN13.
|
||||
|
||||
- parameter input: String that holds ISBN number being validated.
|
||||
- returns: A `Bool` that represents the status of the ISBN number. `false` if ISBN number
|
||||
was not valid, `true` if it was valid.
|
||||
*/
|
||||
func verifyChecksum(_ input: String) -> Bool
|
||||
func verify(input: String) -> Bool
|
||||
func checkRegex(input: String) -> Bool
|
||||
func verifyChecksum(input: String) -> Bool
|
||||
}
|
||||
|
||||
/**
|
||||
`ISBNValidator` defines the extensions that are added to `ISBNValidator`.
|
||||
*/
|
||||
extension ISBNValidator {
|
||||
|
||||
/**
|
||||
Method that actually verifies a ISBN number.
|
||||
|
||||
- parameter input: String that is to be validated against `ISBNRule`
|
||||
- returns: A `Bool` that represents what happened during verification. `false` is returned if
|
||||
it fails, `true` is returned if it was a success.
|
||||
*/
|
||||
func verify(_ input: String) -> Bool {
|
||||
func verify(input: String) -> Bool {
|
||||
return checkRegex(input) && verifyChecksum(input)
|
||||
}
|
||||
|
||||
/**
|
||||
Method that verifies `ISBN` being validated is itself valid. It has to be either ISBN10
|
||||
or ISBN13.
|
||||
|
||||
- parameter input: String that holds ISBN number being validated.
|
||||
- returns: A `Bool` that represents the status of the ISBN number. `false` if ISBN number
|
||||
was not valid, `true` if it was valid.
|
||||
*/
|
||||
func checkRegex(_ input: String) -> Bool {
|
||||
guard let _ = input.range(of: regex, options: [.regularExpression, .anchored]) else {
|
||||
func checkRegex(input: String) -> Bool {
|
||||
guard let _ = input.rangeOfString(regex, options: [.RegularExpressionSearch, .AnchoredSearch]) else {
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
@ -121,34 +55,22 @@ extension ISBNValidator {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
`ISBN10Validator` is a struct that adopts the `ISBNValidator` protocol. Used to validate that
|
||||
a field is an ISBN10 number.
|
||||
*/
|
||||
private struct ISBN10Validator: ISBNValidator {
|
||||
/// Regular expression used to validate ISBN10 number
|
||||
let regex = "^(?:[0-9]{9}X|[0-9]{10})$"
|
||||
|
||||
|
||||
/**
|
||||
Checks that a string is an ISBN10 number.
|
||||
|
||||
- parameter input: String that is checked for ISBN10 validation.
|
||||
- returns: `true` if string is a valid ISBN10 and `false` if it is not.
|
||||
*/
|
||||
fileprivate func verifyChecksum(_ input: String) -> Bool {
|
||||
private func verifyChecksum(input: String) -> Bool {
|
||||
var checksum = 0
|
||||
|
||||
for i in 0..<9 {
|
||||
if let intCharacter = Int(String(input[input.index(input.startIndex, offsetBy: i)])) {
|
||||
if let intCharacter = Int(String(input[input.startIndex.advancedBy(i)])) {
|
||||
checksum += (i + 1) * intCharacter
|
||||
}
|
||||
}
|
||||
|
||||
if (input[input.index(input.startIndex, offsetBy: 9)] == "X") {
|
||||
if (input[input.startIndex.advancedBy(9)] == "X") {
|
||||
checksum += 10 * 10
|
||||
} else {
|
||||
if let intCharacter = Int(String(input[input.index(input.startIndex, offsetBy: 9)])) {
|
||||
if let intCharacter = Int(String(input[input.startIndex.advancedBy(9)])) {
|
||||
checksum += 10 * intCharacter
|
||||
}
|
||||
}
|
||||
|
|
@ -157,35 +79,24 @@ private struct ISBN10Validator: ISBNValidator {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
`ISBN13Validator` is a struct that adopts the `ISBNValidator` protocol. Used to validate that
|
||||
a field is an ISBN13 number.
|
||||
*/
|
||||
private struct ISBN13Validator: ISBNValidator {
|
||||
/// Regular expression used to validate ISBN13 number.
|
||||
let regex = "^(?:[0-9]{13})$"
|
||||
|
||||
/**
|
||||
Checks that a string is an ISBN13 number.
|
||||
|
||||
- parameter input: String that is checked for ISBN13 validation.
|
||||
- returns: `true` if string is a valid ISBN13 and `false` if it is not.
|
||||
*/
|
||||
fileprivate func verifyChecksum(_ input: String) -> Bool {
|
||||
private func verifyChecksum(input: String) -> Bool {
|
||||
let factor = [1, 3]
|
||||
var checksum = 0
|
||||
|
||||
for i in 0..<12 {
|
||||
if let intCharacter = Int(String(input[input.index(input.startIndex, offsetBy: i)])) {
|
||||
if let intCharacter = Int(String(input[input.startIndex.advancedBy(i)])) {
|
||||
print("\(factor[i%2]) * \(intCharacter)")
|
||||
checksum += factor[i % 2] * intCharacter
|
||||
}
|
||||
}
|
||||
|
||||
if let lastInt = Int(String(input[input.index(input.startIndex, offsetBy: 12)])) {
|
||||
if let lastInt = Int(String(input[input.startIndex.advancedBy(12)])) {
|
||||
return (lastInt - ((10 - (checksum % 10)) % 10) == 0)
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -19,29 +19,28 @@ public class MaxLengthRule: Rule {
|
|||
public init(){}
|
||||
|
||||
/**
|
||||
Initializes a `MaxLengthRule` object that is to validate the length of the text of a field.
|
||||
|
||||
Initializes a `MaxLengthRule` object that is to validate the length of the text of a text field
|
||||
- parameter length: Maximum character length.
|
||||
- parameter message: String of error message.
|
||||
- returns: An initialized object, or nil if an object could not be created for some reason that would not result in an exception.
|
||||
*/
|
||||
public init(length: Int, message : String = "Must be at most %ld characters long"){
|
||||
self.DEFAULT_LENGTH = length
|
||||
self.message = String(format: message, self.DEFAULT_LENGTH)
|
||||
self.message = NSString(format: message, self.DEFAULT_LENGTH) as String
|
||||
}
|
||||
|
||||
/**
|
||||
Used to validate a field.
|
||||
Used to validate a text field.
|
||||
|
||||
- parameter value: String to checked for validation.
|
||||
- returns: A boolean value. True if validation is successful; False if validation fails.
|
||||
*/
|
||||
public func validate(_ value: String) -> Bool {
|
||||
return value.count <= DEFAULT_LENGTH
|
||||
public func validate(value: String) -> Bool {
|
||||
return value.characters.count <= DEFAULT_LENGTH
|
||||
}
|
||||
|
||||
/**
|
||||
Displays an error message if a field fails validation.
|
||||
Displays an error message if a text field fails validation.
|
||||
|
||||
- returns: String of error message.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -21,28 +21,27 @@ public class MinLengthRule: Rule {
|
|||
public init(){}
|
||||
|
||||
/**
|
||||
Initializes a `MaxLengthRule` object that is to validate the length of the text of a field.
|
||||
|
||||
Initializes a `MaxLengthRule` object that is to validate the length of the text of a text field
|
||||
- parameter length: Minimum character length.
|
||||
- parameter message: String of error message.
|
||||
- returns: An initialized `MinLengthRule` object, or nil if an object could not be created for some reason that would not result in an exception.
|
||||
*/
|
||||
public init(length: Int, message : String = "Must be at least %ld characters long"){
|
||||
self.DEFAULT_LENGTH = length
|
||||
self.message = String(format: message, self.DEFAULT_LENGTH)
|
||||
self.message = NSString(format: message, self.DEFAULT_LENGTH) as String
|
||||
}
|
||||
|
||||
/**
|
||||
Validates a field.
|
||||
Validates a text field.
|
||||
- parameter value: String to checked for validation.
|
||||
- returns: A boolean value. True if validation is successful; False if validation fails.
|
||||
*/
|
||||
public func validate(_ value: String) -> Bool {
|
||||
return value.count >= DEFAULT_LENGTH
|
||||
public func validate(value: String) -> Bool {
|
||||
return value.characters.count >= DEFAULT_LENGTH
|
||||
}
|
||||
|
||||
/**
|
||||
Displays error message when field has failed validation.
|
||||
Displays error message when text field has failed validation.
|
||||
|
||||
- returns: String of error message.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public class PasswordRule : RegexRule {
|
|||
static let regex = "^(?=.*?[A-Z]).{8,}$"
|
||||
|
||||
/**
|
||||
Initializes a `PasswordRule` object that will validate a field is a valid password.
|
||||
Initializes a `PasswordRule` object that will validate a text field is a valid password.
|
||||
|
||||
- parameter message: String of error message.
|
||||
- returns: An initialized `PasswordRule` object, or nil if an object could not be created for some reason that would not result in an exception.
|
||||
|
|
|
|||
|
|
@ -17,8 +17,7 @@ public class PhoneNumberRule: RegexRule {
|
|||
static let regex = "^\\d{10}$"
|
||||
|
||||
/**
|
||||
Initializes a `PhoneNumberRule` object. Used to validate that a field has a valid phone number.
|
||||
|
||||
Method used to initialize `PhoneNumberRule` object.
|
||||
- parameter message: Error message that is displayed if validation fails.
|
||||
- returns: An initialized `PasswordRule` object, or nil if an object could not be created for some reason that would not result in an exception.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import Foundation
|
|||
/**
|
||||
`RegexRule` is a subclass of Rule that defines how a regular expression is validated.
|
||||
*/
|
||||
open class RegexRule : Rule {
|
||||
public class RegexRule : Rule {
|
||||
/// Regular express string to be used in validation.
|
||||
private var REGEX: String = "^(?=.*?[A-Z]).{8,}$"
|
||||
/// String that holds error message.
|
||||
|
|
@ -30,22 +30,22 @@ open class RegexRule : Rule {
|
|||
}
|
||||
|
||||
/**
|
||||
Method used to validate field.
|
||||
Method used to validate text field.
|
||||
|
||||
- parameter value: String to checked for validation.
|
||||
- returns: Boolean value. True if validation is successful; False if validation fails.
|
||||
*/
|
||||
open func validate(_ value: String) -> Bool {
|
||||
public func validate(value: String) -> Bool {
|
||||
let test = NSPredicate(format: "SELF MATCHES %@", self.REGEX)
|
||||
return test.evaluate(with: value)
|
||||
return test.evaluateWithObject(value)
|
||||
}
|
||||
|
||||
/**
|
||||
Method used to dispaly error message when field fails validation.
|
||||
Method used to dispaly error message when text field fails validation.
|
||||
|
||||
- returns: String of error message.
|
||||
*/
|
||||
open func errorMessage() -> String {
|
||||
public func errorMessage() -> String {
|
||||
return message
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,15 +9,13 @@
|
|||
import Foundation
|
||||
|
||||
/**
|
||||
`RequiredRule` is a subclass of Rule that defines how a required field is validated.
|
||||
`RequiredRule` is a subclass of Rule that defines how a required text field is validated.
|
||||
*/
|
||||
open class RequiredRule: Rule {
|
||||
public class RequiredRule: Rule {
|
||||
/// String that holds error message.
|
||||
private var message : String
|
||||
|
||||
/**
|
||||
Initializes `RequiredRule` object with error message. Used to validate a field that requires text.
|
||||
|
||||
- parameter message: String of error message.
|
||||
- returns: An initialized `RequiredRule` object, or nil if an object could not be created for some reason that would not result in an exception.
|
||||
*/
|
||||
|
|
@ -26,12 +24,12 @@ open class RequiredRule: Rule {
|
|||
}
|
||||
|
||||
/**
|
||||
Validates a field.
|
||||
Validates a text field.
|
||||
|
||||
- parameter value: String to checked for validation.
|
||||
- returns: Boolean value. True if validation is successful; False if validation fails.
|
||||
*/
|
||||
open func validate(_ value: String) -> Bool {
|
||||
public func validate(value: String) -> Bool {
|
||||
return !value.isEmpty
|
||||
}
|
||||
|
||||
|
|
@ -40,7 +38,7 @@ open class RequiredRule: Rule {
|
|||
|
||||
- returns: String of error message.
|
||||
*/
|
||||
open func errorMessage() -> String {
|
||||
public func errorMessage() -> String {
|
||||
return message
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -12,14 +12,14 @@ import Foundation
|
|||
*/
|
||||
public protocol Rule {
|
||||
/**
|
||||
Validates text of a field.
|
||||
Validates text of a text field.
|
||||
|
||||
- parameter value: String of text to be validated.
|
||||
- returns: Boolean value. True if validation is successful; False if validation fails.
|
||||
*/
|
||||
func validate(_ value: String) -> Bool
|
||||
func validate(value: String) -> Bool
|
||||
/**
|
||||
Displays error message of a field that has failed validation.
|
||||
Displays error message of a text field that has failed validation.
|
||||
|
||||
- returns: String of error message.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -9,37 +9,41 @@ import Foundation
|
|||
import UIKit
|
||||
|
||||
/**
|
||||
`ValidationRule` is a class that creates an object which holds validation info of a field.
|
||||
`ValidationRule` is a class that creates an object which holds validation info of a text field.
|
||||
*/
|
||||
public class ValidationRule {
|
||||
/// the field of the field
|
||||
public var field:ValidatableField
|
||||
/// the text field of the field
|
||||
public var textField:UITextField
|
||||
/// the errorLabel of the field
|
||||
public var errorLabel:UILabel?
|
||||
/// the rules of the field
|
||||
public var rules:[Rule] = []
|
||||
/// tuple that holds remote validatin info
|
||||
public var remoteInfo: (urlString: String, error: String)?
|
||||
//public var remoteURLString: String?
|
||||
|
||||
/**
|
||||
Initializes `ValidationRule` instance with field, rules, and errorLabel.
|
||||
Initializes `ValidationRule` instance with text field, rules, and errorLabel.
|
||||
|
||||
- parameter field: field that holds actual text in field.
|
||||
- parameter errorLabel: label that holds error label of field.
|
||||
- parameter rules: array of Rule objects, which field will be validated against.
|
||||
- parameter textField: text field that holds actual text in text field.
|
||||
- parameter errorLabel: label that holds error label of text field.
|
||||
- parameter rules: array of Rule objects, which text field will be validated against.
|
||||
- returns: An initialized `ValidationRule` object, or nil if an object could not be created for some reason that would not result in an exception.
|
||||
*/
|
||||
public init(field: ValidatableField, rules:[Rule], errorLabel:UILabel?){
|
||||
self.field = field
|
||||
|
||||
public init(textField: UITextField, rules:[Rule], errorLabel:UILabel? = nil, remoteInfo: (String, String)? = nil){
|
||||
self.textField = textField
|
||||
self.errorLabel = errorLabel
|
||||
self.rules = rules
|
||||
self.remoteInfo = remoteInfo
|
||||
}
|
||||
|
||||
/**
|
||||
Used to validate field against its validation rules.
|
||||
Used to validate text field against its validation rules.
|
||||
- returns: `ValidationError` object if at least one error is found. Nil is returned if there are no validation errors.
|
||||
*/
|
||||
public func validateField() -> ValidationError? {
|
||||
return rules.filter{
|
||||
return !$0.validate(field.validationText)
|
||||
}.map{ rule -> ValidationError in return ValidationError(field: self.field, errorLabel:self.errorLabel, error: rule.errorMessage()) }.first
|
||||
return rules.filter{ !$0.validate(self.textField.text ?? "") }
|
||||
.map{ rule -> ValidationError in return ValidationError(textField: self.textField, errorLabel:self.errorLabel, error: rule.errorMessage()) }.first
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -48,6 +48,40 @@ class SwiftValidatorTests: XCTestCase {
|
|||
|
||||
let ERROR_LABEL = UILabel()
|
||||
|
||||
let URL_STRING = "http://localhost:8000/emails/"
|
||||
let EMAIL_TAKEN_MESSAGE = "Email already taken"
|
||||
|
||||
class FailureRemoteValidationViewController: UIViewController, ValidationDelegate {
|
||||
func validationSuccessful() {
|
||||
|
||||
}
|
||||
|
||||
func validationFailed(errors: [UITextField : ValidationError]) {
|
||||
|
||||
}
|
||||
|
||||
func remoteValidationRequest(text: String, urlString: String, completion: (result: Bool) -> Void) {
|
||||
completion(result: false)
|
||||
}
|
||||
}
|
||||
|
||||
class SuccessRemoteValidationViewController: UIViewController, ValidationDelegate {
|
||||
func validationSuccessful() {
|
||||
|
||||
}
|
||||
|
||||
func validationFailed(errors: [UITextField : ValidationError]) {
|
||||
|
||||
}
|
||||
|
||||
func remoteValidationRequest(text: String, urlString: String, completion: (result: Bool) -> Void) {
|
||||
completion(result: true)
|
||||
}
|
||||
}
|
||||
|
||||
let REGISTER_FAILURE_REMOTE_VALIDATION_DELEGATE = FailureRemoteValidationViewController()
|
||||
let REGISTER_SUCCESS_REMOTE_VALIDATION_DELEGATE = SuccessRemoteValidationViewController()
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
|
|
@ -366,10 +400,48 @@ class SwiftValidatorTests: XCTestCase {
|
|||
}
|
||||
REGISTER_TXT_FIELD.text = INVALID_EMAIL
|
||||
REGISTER_VALIDATOR.validateField(REGISTER_TXT_FIELD) { error in
|
||||
XCTAssert(error?.errorMessage.count ?? 0 > 0, "Should state 'invalid email'")
|
||||
XCTAssert(error?.errorMessage.characters.count > 0, "Should state 'invalid email'")
|
||||
}
|
||||
}
|
||||
|
||||
/// Used to test validation success on a single field that has remote validation
|
||||
func testValidateSuccessSingleRemoteField() {
|
||||
REGISTER_TXT_FIELD.text = VALID_EMAIL
|
||||
REGISTER_VALIDATOR.registerField(REGISTER_TXT_FIELD, errorLabel: ERROR_LABEL, rules: [EmailRule()], remoteInfo: (urlString: URL_STRING, error: EMAIL_TAKEN_MESSAGE))
|
||||
REGISTER_VALIDATOR.delegate = REGISTER_SUCCESS_REMOTE_VALIDATION_DELEGATE
|
||||
REGISTER_VALIDATOR.validateRemoteField(REGISTER_TXT_FIELD) { error -> Void in
|
||||
XCTAssertNil(error)
|
||||
}
|
||||
}
|
||||
|
||||
/// Used to test validation failure on a single field that has remote validation
|
||||
func testValidateFailureSingleRemoteField() {
|
||||
REGISTER_TXT_FIELD.text = VALID_EMAIL
|
||||
REGISTER_VALIDATOR.registerField(REGISTER_TXT_FIELD, errorLabel: ERROR_LABEL, rules: [EmailRule()], remoteInfo: (urlString: URL_STRING, error: EMAIL_TAKEN_MESSAGE))
|
||||
REGISTER_VALIDATOR.delegate = REGISTER_FAILURE_REMOTE_VALIDATION_DELEGATE
|
||||
REGISTER_VALIDATOR.validateRemoteField(REGISTER_TXT_FIELD) { error -> Void in
|
||||
XCTAssertNotNil(error)
|
||||
}
|
||||
}
|
||||
|
||||
/// Used to test remote validation success
|
||||
func testValidationSuccessOnRemoteSuccess() {
|
||||
REGISTER_TXT_FIELD.text = VALID_EMAIL
|
||||
REGISTER_VALIDATOR.registerField(REGISTER_TXT_FIELD, errorLabel: ERROR_LABEL, rules: [EmailRule()], remoteInfo: (urlString: URL_STRING, error: EMAIL_TAKEN_MESSAGE))
|
||||
REGISTER_VALIDATOR.delegate = REGISTER_SUCCESS_REMOTE_VALIDATION_DELEGATE
|
||||
REGISTER_VALIDATOR.validate()
|
||||
XCTAssert(REGISTER_VALIDATOR.errors.count == 0)
|
||||
}
|
||||
|
||||
/// Used to test remote validation failure
|
||||
func testValidationFailOnRemoteFailure() {
|
||||
REGISTER_TXT_FIELD.text = VALID_EMAIL
|
||||
REGISTER_VALIDATOR.registerField(REGISTER_TXT_FIELD, errorLabel: ERROR_LABEL, rules: [EmailRule()], remoteInfo: (urlString: URL_STRING, error: EMAIL_TAKEN_MESSAGE))
|
||||
REGISTER_VALIDATOR.delegate = REGISTER_FAILURE_REMOTE_VALIDATION_DELEGATE
|
||||
REGISTER_VALIDATOR.validate()
|
||||
XCTAssert(REGISTER_VALIDATOR.errors.count == 1, "There is at least one error")
|
||||
}
|
||||
|
||||
// MARK: Validate error field gets it's text set to the error, if supplied
|
||||
|
||||
func testNoErrorMessageSet() {
|
||||
|
|
@ -385,9 +457,9 @@ class SwiftValidatorTests: XCTestCase {
|
|||
var successCount = 0
|
||||
var errorCount = 0
|
||||
REGISTER_VALIDATOR.styleTransformers(success: { (validationRule) -> Void in
|
||||
successCount+=1
|
||||
successCount++
|
||||
}) { (validationError) -> Void in
|
||||
errorCount+=1
|
||||
errorCount++
|
||||
}
|
||||
REGISTER_TXT_FIELD.text = INVALID_EMAIL
|
||||
REGISTER_VALIDATOR.validate { (errors) -> Void in
|
||||
|
|
@ -403,9 +475,9 @@ class SwiftValidatorTests: XCTestCase {
|
|||
var successCount = 0
|
||||
var errorCount = 0
|
||||
REGISTER_VALIDATOR.styleTransformers(success: { (validationRule) -> Void in
|
||||
successCount+=1
|
||||
successCount++
|
||||
}) { (validationError) -> Void in
|
||||
errorCount+=1
|
||||
errorCount++
|
||||
}
|
||||
|
||||
REGISTER_TXT_FIELD.text = INVALID_EMAIL
|
||||
|
|
@ -427,7 +499,7 @@ class SwiftValidatorTests: XCTestCase {
|
|||
REGISTER_TXT_FIELD.text = INVALID_EMAIL
|
||||
REGISTER_VALIDATOR.validate { (errors) -> Void in
|
||||
XCTAssert(errors.count == 1, "Should come back with errors")
|
||||
XCTAssert(!(self.REGISTER_TXT_FIELD.layer.borderColor! == UIColor.red.cgColor), "Color shouldn't get set at all")
|
||||
XCTAssert(!CGColorEqualToColor(self.REGISTER_TXT_FIELD.layer.borderColor, UIColor.redColor().CGColor), "Color shouldn't get set at all")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
62D1AE221A1E6D4400E4DFF8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 62D1AE201A1E6D4400E4DFF8 /* Main.storyboard */; };
|
||||
62D1AE241A1E6D4400E4DFF8 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 62D1AE231A1E6D4400E4DFF8 /* Images.xcassets */; };
|
||||
62D1AE271A1E6D4400E4DFF8 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 62D1AE251A1E6D4400E4DFF8 /* LaunchScreen.xib */; };
|
||||
62D9B2561C7C0B2A00BAFCE3 /* ValidationDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62D9B2551C7C0B2A00BAFCE3 /* ValidationDelegate.swift */; };
|
||||
62D9B2561C7C0B2A00BAFCE3 /* ValidationDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62D9B2551C7C0B2A00BAFCE3 /* ValidationDelegate.swift */; settings = {ASSET_TAGS = (); }; };
|
||||
7CC1E4CF1C636B4500AF013C /* AlphaRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CC1E4CE1C636B4500AF013C /* AlphaRule.swift */; };
|
||||
7CC1E4D11C637A7700AF013C /* AlphaNumericRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CC1E4D01C637A7700AF013C /* AlphaNumericRule.swift */; };
|
||||
7CC1E4D31C637ABC00AF013C /* CharacterSetRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CC1E4D21C637ABC00AF013C /* CharacterSetRule.swift */; };
|
||||
|
|
@ -40,8 +40,6 @@
|
|||
FB465CFF1B9889EA00398388 /* ZipCodeRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB465CEF1B9889EA00398388 /* ZipCodeRule.swift */; };
|
||||
FB465D001B9889EA00398388 /* ValidationError.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB465CF11B9889EA00398388 /* ValidationError.swift */; };
|
||||
FB465D011B9889EA00398388 /* Validator.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB465CF21B9889EA00398388 /* Validator.swift */; };
|
||||
FB51E5B01CD208B8004DE696 /* Validatable.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB51E5AF1CD208B8004DE696 /* Validatable.swift */; };
|
||||
FBA963631CDA10130071F03E /* ValidatorDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBA963621CDA10130071F03E /* ValidatorDictionary.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
|
|
@ -128,8 +126,6 @@
|
|||
FB465CEF1B9889EA00398388 /* ZipCodeRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ZipCodeRule.swift; sourceTree = "<group>"; };
|
||||
FB465CF11B9889EA00398388 /* ValidationError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValidationError.swift; sourceTree = "<group>"; };
|
||||
FB465CF21B9889EA00398388 /* Validator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Validator.swift; sourceTree = "<group>"; };
|
||||
FB51E5AF1CD208B8004DE696 /* Validatable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Validatable.swift; sourceTree = "<group>"; };
|
||||
FBA963621CDA10130071F03E /* ValidatorDictionary.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValidatorDictionary.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
|
|
@ -294,8 +290,6 @@
|
|||
62D9B2551C7C0B2A00BAFCE3 /* ValidationDelegate.swift */,
|
||||
FB465CF11B9889EA00398388 /* ValidationError.swift */,
|
||||
FB465CF21B9889EA00398388 /* Validator.swift */,
|
||||
FB51E5AF1CD208B8004DE696 /* Validatable.swift */,
|
||||
FBA963621CDA10130071F03E /* ValidatorDictionary.swift */,
|
||||
);
|
||||
path = Core;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -396,25 +390,21 @@
|
|||
attributes = {
|
||||
LastSwiftMigration = 0700;
|
||||
LastSwiftUpdateCheck = 0700;
|
||||
LastUpgradeCheck = 0930;
|
||||
LastUpgradeCheck = 0700;
|
||||
ORGANIZATIONNAME = jpotts18;
|
||||
TargetAttributes = {
|
||||
62D1AE161A1E6D4400E4DFF8 = {
|
||||
CreatedOnToolsVersion = 6.1;
|
||||
LastSwiftMigration = 0800;
|
||||
};
|
||||
62D1AE2B1A1E6D4500E4DFF8 = {
|
||||
CreatedOnToolsVersion = 6.1;
|
||||
LastSwiftMigration = 0800;
|
||||
TestTargetID = 62D1AE161A1E6D4400E4DFF8;
|
||||
};
|
||||
FB465CB21B9884F400398388 = {
|
||||
CreatedOnToolsVersion = 6.4;
|
||||
LastSwiftMigration = 1010;
|
||||
};
|
||||
FB465CBC1B9884F400398388 = {
|
||||
CreatedOnToolsVersion = 6.4;
|
||||
LastSwiftMigration = 1010;
|
||||
TestTargetID = 62D1AE161A1E6D4400E4DFF8;
|
||||
};
|
||||
};
|
||||
|
|
@ -497,7 +487,6 @@
|
|||
files = (
|
||||
FB465CF41B9889EA00398388 /* EmailRule.swift in Sources */,
|
||||
FB465CF61B9889EA00398388 /* FullNameRule.swift in Sources */,
|
||||
FBA963631CDA10130071F03E /* ValidatorDictionary.swift in Sources */,
|
||||
FB465CFF1B9889EA00398388 /* ZipCodeRule.swift in Sources */,
|
||||
FB465CF91B9889EA00398388 /* PasswordRule.swift in Sources */,
|
||||
7CC1E4D11C637A7700AF013C /* AlphaNumericRule.swift in Sources */,
|
||||
|
|
@ -509,7 +498,6 @@
|
|||
FB465D011B9889EA00398388 /* Validator.swift in Sources */,
|
||||
FB465CFE1B9889EA00398388 /* ValidationRule.swift in Sources */,
|
||||
FB465CF31B9889EA00398388 /* ConfirmRule.swift in Sources */,
|
||||
FB51E5B01CD208B8004DE696 /* Validatable.swift in Sources */,
|
||||
7CC1E4D51C637C8500AF013C /* IPV4Rule.swift in Sources */,
|
||||
7CC1E4D71C637F6E00AF013C /* ISBNRule.swift in Sources */,
|
||||
FB465D001B9889EA00398388 /* ValidationError.swift in Sources */,
|
||||
|
|
@ -584,23 +572,13 @@
|
|||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
|
|
@ -609,7 +587,6 @@
|
|||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
|
|
@ -627,7 +604,6 @@
|
|||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 4.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
|
|
@ -639,23 +615,13 @@
|
|||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
|
|
@ -663,7 +629,6 @@
|
|||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
|
|
@ -673,8 +638,6 @@
|
|||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_VERSION = 4.0;
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
|
|
@ -687,7 +650,6 @@
|
|||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "me.jeffpotter.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 4.2;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
|
|
@ -699,8 +661,6 @@
|
|||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "me.jeffpotter.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_VERSION = 4.2;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
|
@ -716,7 +676,6 @@
|
|||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "me.jeffpotter.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 4.1;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Validator.app/Validator";
|
||||
};
|
||||
name = Debug;
|
||||
|
|
@ -729,7 +688,6 @@
|
|||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "me.jeffpotter.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 4.1;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Validator.app/Validator";
|
||||
};
|
||||
name = Release;
|
||||
|
|
@ -737,7 +695,6 @@
|
|||
FB465CCC1B9884F400398388 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEFINES_MODULE = YES;
|
||||
|
|
@ -755,7 +712,6 @@
|
|||
PRODUCT_BUNDLE_IDENTIFIER = "me.jeffpotter.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 4.2;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
|
|
@ -765,7 +721,6 @@
|
|||
FB465CCD1B9884F400398388 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
|
|
@ -780,8 +735,6 @@
|
|||
PRODUCT_BUNDLE_IDENTIFIER = "me.jeffpotter.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_VERSION = 4.2;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
|
|
@ -806,7 +759,6 @@
|
|||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.levous.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 4.2;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Validator.app/Validator";
|
||||
};
|
||||
name = Debug;
|
||||
|
|
@ -826,8 +778,6 @@
|
|||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.levous.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_VERSION = 4.2;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Validator.app/Validator";
|
||||
};
|
||||
name = Release;
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0930"
|
||||
LastUpgradeVersion = "0700"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0930"
|
||||
LastUpgradeVersion = "0700"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
|
@ -26,8 +26,8 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
codeCoverageEnabled = "YES"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
codeCoverageEnabled = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0930"
|
||||
LastUpgradeVersion = "0700"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
|
|
|||
|
|
@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
|||
var window: UIWindow?
|
||||
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
|
||||
// Override point for customization after application launch.
|
||||
return true
|
||||
}
|
||||
|
||||
func applicationWillResignActive(_ application: UIApplication) {
|
||||
func applicationWillResignActive(application: UIApplication) {
|
||||
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
||||
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
|
||||
}
|
||||
|
||||
func applicationDidEnterBackground(_ application: UIApplication) {
|
||||
func applicationDidEnterBackground(application: UIApplication) {
|
||||
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
||||
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
||||
}
|
||||
|
||||
func applicationWillEnterForeground(_ application: UIApplication) {
|
||||
func applicationWillEnterForeground(application: UIApplication) {
|
||||
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
|
||||
}
|
||||
|
||||
func applicationDidBecomeActive(_ application: UIApplication) {
|
||||
func applicationDidBecomeActive(application: UIApplication) {
|
||||
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
||||
}
|
||||
|
||||
func applicationWillTerminate(_ application: UIApplication) {
|
||||
func applicationWillTerminate(application: UIApplication) {
|
||||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,61 +31,82 @@ class ViewController: UIViewController , ValidationDelegate, UITextFieldDelegate
|
|||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
self.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(ViewController.hideKeyboard)))
|
||||
self.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: "hideKeyboard"))
|
||||
|
||||
validator.styleTransformers(success:{ (validationRule) -> Void in
|
||||
print("here")
|
||||
// clear error label
|
||||
validationRule.errorLabel?.isHidden = true
|
||||
validationRule.errorLabel?.text = ""
|
||||
if let textField = validationRule.field as? UITextField {
|
||||
textField.layer.borderColor = UIColor.green.cgColor
|
||||
textField.layer.borderWidth = 0.5
|
||||
|
||||
}
|
||||
}, error:{ (validationError) -> Void in
|
||||
print("error")
|
||||
validationError.errorLabel?.isHidden = false
|
||||
validationError.errorLabel?.text = validationError.errorMessage
|
||||
if let textField = validationError.field as? UITextField {
|
||||
textField.layer.borderColor = UIColor.red.cgColor
|
||||
textField.layer.borderWidth = 1.0
|
||||
}
|
||||
// clear error label
|
||||
validationRule.errorLabel?.hidden = true
|
||||
validationRule.errorLabel?.text = ""
|
||||
validationRule.textField.layer.borderColor = UIColor.greenColor().CGColor
|
||||
validationRule.textField.layer.borderWidth = 0.5
|
||||
|
||||
}, error:{ (validationError) -> Void in
|
||||
print("error")
|
||||
validationError.errorLabel?.hidden = false
|
||||
validationError.errorLabel?.text = validationError.errorMessage
|
||||
validationError.textField.layer.borderColor = UIColor.redColor().CGColor
|
||||
validationError.textField.layer.borderWidth = 1.0
|
||||
})
|
||||
|
||||
validator.registerField(fullNameTextField, errorLabel: fullNameErrorLabel , rules: [RequiredRule(), FullNameRule()])
|
||||
validator.registerField(emailTextField, errorLabel: emailErrorLabel, rules: [RequiredRule(), EmailRule()])
|
||||
validator.registerField(emailTextField, errorLabel: emailErrorLabel, rules: [RequiredRule(), EmailRule()], remoteInfo: (urlString: "http://localhost:8000/emails/", error: "Email already in use"))
|
||||
validator.registerField(emailConfirmTextField, errorLabel: emailConfirmErrorLabel, rules: [RequiredRule(), ConfirmationRule(confirmField: emailTextField)])
|
||||
validator.registerField(phoneNumberTextField, errorLabel: phoneNumberErrorLabel, rules: [RequiredRule(), MinLengthRule(length: 9)])
|
||||
validator.registerField(zipcodeTextField, errorLabel: zipcodeErrorLabel, rules: [RequiredRule(), ZipCodeRule()])
|
||||
validator.delegate = self
|
||||
}
|
||||
|
||||
@IBAction func submitTapped(_ sender: AnyObject) {
|
||||
@IBAction func submitTapped(sender: AnyObject) {
|
||||
print("Validating...")
|
||||
validator.validate(self)
|
||||
validator.validate()
|
||||
}
|
||||
|
||||
func simulateRemoteRequest(seconds: Int64, completion: (result: Bool) -> Void) {
|
||||
print("Simulating \(seconds) second server request...")
|
||||
// Set number of seconds before "request" is finished
|
||||
let triggerTime = (Int64(NSEC_PER_SEC) * seconds)
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, triggerTime), dispatch_get_main_queue(), { () -> Void in
|
||||
// For example purposes, if user does not enter David Patterson as full name,
|
||||
// the email they tried will be already taken
|
||||
if self.fullNameTextField.text! == "David Patterson" {
|
||||
completion(result: true)
|
||||
} else {
|
||||
completion(result: false)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func hideKeyboard(){
|
||||
self.view.endEditing(true)
|
||||
}
|
||||
|
||||
// MARK: ValidationDelegate Methods
|
||||
|
||||
func validationSuccessful() {
|
||||
print("Validation Success!")
|
||||
let alert = UIAlertController(title: "Success", message: "You are validated!", preferredStyle: UIAlertController.Style.alert)
|
||||
let defaultAction = UIAlertAction(title: "OK", style: .default, handler: nil)
|
||||
let alert = UIAlertController(title: "Success", message: "You are validated, \(fullNameTextField.text!)!", preferredStyle: UIAlertControllerStyle.Alert)
|
||||
let defaultAction = UIAlertAction(title: "OK", style: .Default, handler: nil)
|
||||
alert.addAction(defaultAction)
|
||||
self.present(alert, animated: true, completion: nil)
|
||||
self.presentViewController(alert, animated: true, completion: nil)
|
||||
|
||||
}
|
||||
func validationFailed(_ errors:[(Validatable, ValidationError)]) {
|
||||
print("Validation FAILED!")
|
||||
|
||||
func validationFailed(errors:[UITextField:ValidationError]) {
|
||||
print("Validation FAILED!", validator.errors.count)
|
||||
}
|
||||
|
||||
@objc func hideKeyboard(){
|
||||
self.view.endEditing(true)
|
||||
func remoteValidationRequest(text: String, urlString: String, completion: (result: Bool) -> Void) {
|
||||
simulateRemoteRequest(2) { result -> Void in
|
||||
// Set result to true if field was validated server-side
|
||||
// Set to false if field was not validated server-side
|
||||
completion(result: result)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Validate single field
|
||||
// Don't forget to use UITextFieldDelegate
|
||||
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
|
||||
func textFieldShouldReturn(textField: UITextField) -> Bool {
|
||||
validator.validateField(textField){ error in
|
||||
if error == nil {
|
||||
// Field validation was successful
|
||||
|
|
@ -96,4 +117,4 @@ class ViewController: UIViewController , ValidationDelegate, UITextFieldDelegate
|
|||
return true
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -29,15 +29,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -53,15 +44,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -243,71 +225,6 @@
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C14SwiftValidator16AlphaNumericRule"></a>
|
||||
<a name="//apple_ref/swift/Class/AlphaNumericRule" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C14SwiftValidator16AlphaNumericRule">AlphaNumericRule</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p><code>AlphaNumericRule</code> is a subclass of <code><a href="Classes/CharacterSetRule.html">CharacterSetRule</a></code>. It is used to verify that a field has a
|
||||
valid list of alphanumeric characters.</p>
|
||||
|
||||
<a href="Classes/AlphaNumericRule.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">AlphaNumericRule</span><span class="p">:</span> <span class="kt">CharacterSetRule</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C14SwiftValidator16CharacterSetRule"></a>
|
||||
<a name="//apple_ref/swift/Class/CharacterSetRule" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C14SwiftValidator16CharacterSetRule">CharacterSetRule</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p><code>CharacterSetRule</code> is a subclass of <code><a href="Protocols/Rule.html">Rule</a></code>. It is used to validate IPV4 address fields.</p>
|
||||
|
||||
<a href="Classes/CharacterSetRule.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">CharacterSetRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
|
|
@ -372,38 +289,6 @@ valid list of alphanumeric characters.</p>
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C14SwiftValidator12HexColorRule"></a>
|
||||
<a name="//apple_ref/swift/Class/HexColorRule" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C14SwiftValidator12HexColorRule">HexColorRule</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p><code>HexColorRule</code> is a subclass of <code><a href="Classes/RegexRule.html">RegexRule</a></code>. It is used to verify whether a field is a hexadecimal color.</p>
|
||||
|
||||
<a href="Classes/HexColorRule.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">HexColorRule</span><span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
|
|
@ -502,70 +387,6 @@ to another text field is validated.</p>
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C14SwiftValidator8IPV4Rule"></a>
|
||||
<a name="//apple_ref/swift/Class/IPV4Rule" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C14SwiftValidator8IPV4Rule">IPV4Rule</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p><code>IPV4Rule</code> is a subclass of RegexRule that defines how a IPV4 address validated.</p>
|
||||
|
||||
<a href="Classes/IPV4Rule.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">IPV4Rule</span><span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C14SwiftValidator8ISBNRule"></a>
|
||||
<a name="//apple_ref/swift/Class/ISBNRule" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C14SwiftValidator8ISBNRule">ISBNRule</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p><code>ISBNRule</code> is a subclass of <code><a href="Protocols/Rule.html">Rule</a></code>. It is used to verify whether a field is a valid ISBN number.</p>
|
||||
|
||||
<a href="Classes/ISBNRule.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ISBNRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
|
|
@ -662,39 +483,6 @@ to another text field is validated.</p>
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C14SwiftValidator9AlphaRule"></a>
|
||||
<a name="//apple_ref/swift/Class/AlphaRule" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C14SwiftValidator9AlphaRule">AlphaRule</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p><code>AlphaRule</code> is a subclass of <code><a href="Classes/CharacterSetRule.html">CharacterSetRule</a></code>. It is used to verify that a field has a
|
||||
valid list of alpha characters.</p>
|
||||
|
||||
<a href="Classes/AlphaRule.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">AlphaRule</span><span class="p">:</span> <span class="kt">CharacterSetRule</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
|
|
@ -794,7 +582,7 @@ valid list of alpha characters.</p>
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -1,192 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>AlphaNumericRule Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/AlphaNumericRule" class="dashAnchor"></a>
|
||||
<a title="AlphaNumericRule Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">SwiftValidator Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
AlphaNumericRule Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/EmailRule.html">EmailRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/FloatRule.html">FloatRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PasswordRule.html">PasswordRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/RegexRule.html">RegexRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/RequiredRule.html">RequiredRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ValidationError.html">ValidationError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ValidationRule.html">ValidationRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Validator.html">Validator</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/Rule.html">Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>AlphaNumericRule</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">AlphaNumericRule</span><span class="p">:</span> <span class="kt">CharacterSetRule</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p><code>AlphaNumericRule</code> is a subclass of <code><a href="../Classes/CharacterSetRule.html">CharacterSetRule</a></code>. It is used to verify that a field has a
|
||||
valid list of alphanumeric characters.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14SwiftValidator16AlphaNumericRulecFMS0_FT7messageSS_S0_"></a>
|
||||
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14SwiftValidator16AlphaNumericRulecFMS0_FT7messageSS_S0_">init(message:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes a <code><a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a></code> object to verify that field has valid set of alphanumeric characters.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Enter valid numeric characters"</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>message</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>String of error message.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,192 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>AlphaRule Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/AlphaRule" class="dashAnchor"></a>
|
||||
<a title="AlphaRule Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">SwiftValidator Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
AlphaRule Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/EmailRule.html">EmailRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/FloatRule.html">FloatRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PasswordRule.html">PasswordRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/RegexRule.html">RegexRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/RequiredRule.html">RequiredRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ValidationError.html">ValidationError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ValidationRule.html">ValidationRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Validator.html">Validator</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/Rule.html">Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>AlphaRule</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">AlphaRule</span><span class="p">:</span> <span class="kt">CharacterSetRule</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p><code>AlphaRule</code> is a subclass of <code><a href="../Classes/CharacterSetRule.html">CharacterSetRule</a></code>. It is used to verify that a field has a
|
||||
valid list of alpha characters.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14SwiftValidator9AlphaRulecFMS0_FT7messageSS_S0_"></a>
|
||||
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14SwiftValidator9AlphaRulecFMS0_FT7messageSS_S0_">init(message:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes an <code><a href="../Classes/AlphaRule.html">AlphaRule</a></code> object to verify that a field has valid set of alpha characters.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Enter valid alphabetic characters"</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>message</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>String of error message.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An initialized object, or nil if an object could not be created for some reason.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,288 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>CharacterSetRule Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/CharacterSetRule" class="dashAnchor"></a>
|
||||
<a title="CharacterSetRule Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">SwiftValidator Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
CharacterSetRule Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/EmailRule.html">EmailRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/FloatRule.html">FloatRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PasswordRule.html">PasswordRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/RegexRule.html">RegexRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/RequiredRule.html">RequiredRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ValidationError.html">ValidationError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ValidationRule.html">ValidationRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Validator.html">Validator</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/Rule.html">Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>CharacterSetRule</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">CharacterSetRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p><code>CharacterSetRule</code> is a subclass of <code><a href="../Protocols/Rule.html">Rule</a></code>. It is used to validate IPV4 address fields.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14SwiftValidator16CharacterSetRulecFMS0_FT12characterSetCSo14NSCharacterSet7messageSS_S0_"></a>
|
||||
<a name="//apple_ref/swift/Method/init(characterSet:message:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14SwiftValidator16CharacterSetRulecFMS0_FT12characterSetCSo14NSCharacterSet7messageSS_S0_">init(characterSet:message:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes a <code><a href="../Classes/CharacterSetRule.html">CharacterSetRule</a></code> object to verify that field has valid set of characters.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">characterSet</span><span class="p">:</span> <span class="kt">NSCharacterSet</span><span class="p">,</span> <span class="nv">message</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Enter valid alpha"</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>characterSet</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>NSCharacterSet that holds group of valid characters.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>message</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>String of error message.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14SwiftValidator16CharacterSetRule8validateFS0_FSSSb"></a>
|
||||
<a name="//apple_ref/swift/Method/validate(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14SwiftValidator16CharacterSetRule8validateFS0_FSSSb">validate(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Used to validate field.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="nv">value</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Bool</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>value</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>String to checked for validation.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>Boolean value. True if validation is successful; False if validation fails.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14SwiftValidator16CharacterSetRule12errorMessageFS0_FT_SS"></a>
|
||||
<a name="//apple_ref/swift/Method/errorMessage()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14SwiftValidator16CharacterSetRule12errorMessageFS0_FT_SS">errorMessage()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Displays error message when text field fails validation.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">errorMessage</span><span class="p">()</span> <span class="o">-></span> <span class="kt">String</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>String of error message.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -279,7 +261,7 @@ to another text field is validated.</p>
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -181,7 +163,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -278,7 +260,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -265,7 +247,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -265,7 +247,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -1,191 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>HexColorRule Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/HexColorRule" class="dashAnchor"></a>
|
||||
<a title="HexColorRule Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">SwiftValidator Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
HexColorRule Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/EmailRule.html">EmailRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/FloatRule.html">FloatRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PasswordRule.html">PasswordRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/RegexRule.html">RegexRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/RequiredRule.html">RequiredRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ValidationError.html">ValidationError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ValidationRule.html">ValidationRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Validator.html">Validator</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/Rule.html">Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>HexColorRule</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">HexColorRule</span><span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p><code>HexColorRule</code> is a subclass of <code><a href="../Classes/RegexRule.html">RegexRule</a></code>. It is used to verify whether a field is a hexadecimal color.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14SwiftValidator12HexColorRulecFMS0_FT7messageSS_S0_"></a>
|
||||
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14SwiftValidator12HexColorRulecFMS0_FT7messageSS_S0_">init(message:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes a <code>HexaColorRule</code> object to verify that field has text in hexadecimal color format.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Invalid regular expression"</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>message</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>String of error message.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,191 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>IPV4Rule Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/IPV4Rule" class="dashAnchor"></a>
|
||||
<a title="IPV4Rule Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">SwiftValidator Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
IPV4Rule Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/EmailRule.html">EmailRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/FloatRule.html">FloatRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PasswordRule.html">PasswordRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/RegexRule.html">RegexRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/RequiredRule.html">RequiredRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ValidationError.html">ValidationError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ValidationRule.html">ValidationRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Validator.html">Validator</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/Rule.html">Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>IPV4Rule</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">IPV4Rule</span><span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p><code>IPV4Rule</code> is a subclass of RegexRule that defines how a IPV4 address validated.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14SwiftValidator8IPV4RulecFMS0_FT7messageSS_S0_"></a>
|
||||
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14SwiftValidator8IPV4RulecFMS0_FT7messageSS_S0_">init(message:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes a <code><a href="../Classes/IPV4Rule.html">IPV4Rule</a></code> object to verify that field has text is an IPV4Rule address.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Must be a valid IPV4 address"</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>message</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>String of error message.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,275 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>ISBNRule Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/ISBNRule" class="dashAnchor"></a>
|
||||
<a title="ISBNRule Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">SwiftValidator Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
ISBNRule Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/EmailRule.html">EmailRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/FloatRule.html">FloatRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PasswordRule.html">PasswordRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/RegexRule.html">RegexRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/RequiredRule.html">RequiredRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ValidationError.html">ValidationError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ValidationRule.html">ValidationRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Validator.html">Validator</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/Rule.html">Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>ISBNRule</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ISBNRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p><code>ISBNRule</code> is a subclass of <code><a href="../Protocols/Rule.html">Rule</a></code>. It is used to verify whether a field is a valid ISBN number.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14SwiftValidator8ISBNRulecFMS0_FT7messageSS_S0_"></a>
|
||||
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14SwiftValidator8ISBNRulecFMS0_FT7messageSS_S0_">init(message:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes a <code><a href="../Classes/ISBNRule.html">ISBNRule</a></code> object to verify that field has text that is a ISBN number.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Enter valid ISBN number"</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>message</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>String of error message.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14SwiftValidator8ISBNRule8validateFS0_FSSSb"></a>
|
||||
<a name="//apple_ref/swift/Method/validate(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14SwiftValidator8ISBNRule8validateFS0_FSSSb">validate(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Method used to validate text field.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="nv">value</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Bool</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>value</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>String to checked for validation.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>Boolean value. True if validation is successful; False if validation fails.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14SwiftValidator8ISBNRule12errorMessageFS0_FT_SS"></a>
|
||||
<a name="//apple_ref/swift/Method/errorMessage()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14SwiftValidator8ISBNRule12errorMessageFS0_FT_SS">errorMessage()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Method used to dispaly error message when text field fails validation.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">errorMessage</span><span class="p">()</span> <span class="o">-></span> <span class="kt">String</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>String of error message.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -168,7 +150,10 @@
|
|||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes a <code><a href="../Classes/MaxLengthRule.html">MaxLengthRule</a></code> object that is to validate the length of the text of a text field.</p>
|
||||
<p>Initializes a <code><a href="../Classes/MaxLengthRule.html">MaxLengthRule</a></code> object that is to validate the length of the text of a text field
|
||||
- parameter length: Maximum character length.
|
||||
- parameter message: String of error message.
|
||||
- returns: An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
|
|
@ -309,7 +294,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -168,7 +150,10 @@
|
|||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes a <code><a href="../Classes/MaxLengthRule.html">MaxLengthRule</a></code> object that is to validate the length of the text of a text field.</p>
|
||||
<p>Initializes a <code><a href="../Classes/MaxLengthRule.html">MaxLengthRule</a></code> object that is to validate the length of the text of a text field
|
||||
- parameter length: Minimum character length.
|
||||
- parameter message: String of error message.
|
||||
- returns: An initialized <code><a href="../Classes/MinLengthRule.html">MinLengthRule</a></code> object, or nil if an object could not be created for some reason that would not result in an exception.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
|
|
@ -311,7 +296,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -181,7 +163,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -137,7 +119,9 @@
|
|||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes a <code><a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a></code> object. Used to validate that a field has a valid phone number.</p>
|
||||
<p>Method used to initialize <code><a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a></code> object.
|
||||
- parameter message: Error message that is displayed if validation fails.
|
||||
- returns: An initialized <code><a href="../Classes/PasswordRule.html">PasswordRule</a></code> object, or nil if an object could not be created for some reason that would not result in an exception.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
|
|
@ -181,7 +165,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -278,7 +260,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -137,8 +119,7 @@
|
|||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes <code><a href="../Classes/RequiredRule.html">RequiredRule</a></code> object with error message. Used to validate a field that requires text.</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
|
|
@ -265,7 +246,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -218,7 +200,10 @@
|
|||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes <code><a href="../Classes/ValidationError.html">ValidationError</a></code> object with a textField and error.</p>
|
||||
<p>Initializes <code><a href="../Classes/ValidationError.html">ValidationError</a></code> object with a textField and error.
|
||||
- parameter textField: UITextField that holds textField.
|
||||
- parameter errorMessage: String that holds error message.
|
||||
- returns: An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
|
|
@ -283,7 +268,11 @@
|
|||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes <code><a href="../Classes/ValidationError.html">ValidationError</a></code> object with a textField, errorLabel, and errorMessage.</p>
|
||||
<p>Initializes ValidationError object with a textField, errorLabel, and errorMessage.
|
||||
- parameter textField: UITextField that holds textField.
|
||||
- parameter errorLabel: UILabel that holds error label.
|
||||
- parameter errorMessage: String that holds error message.
|
||||
- returns: An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
|
|
@ -353,7 +342,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -321,7 +303,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -235,7 +217,9 @@ validation fields.</p>
|
|||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>This method is used to validate a single field registered to Validator. If validation is unsuccessful,
|
||||
field gets added to errors dictionary.</p>
|
||||
field gets added to errors dictionary.
|
||||
- parameter textField: Holds validator field data.
|
||||
- returns: No return value.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
|
|
@ -634,7 +618,7 @@ field gets added to errors dictionary.</p>
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -181,7 +163,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -29,15 +29,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -53,15 +44,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -182,7 +164,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -213,7 +195,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -137,7 +119,8 @@
|
|||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>This method will be called on delegate object when validation is successful.</p>
|
||||
<p>This method will be called on delegate object when validation is successful.
|
||||
- returns: No return value.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
|
|
@ -169,7 +152,8 @@
|
|||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>This method will be called on delegate object when validation fails.</p>
|
||||
<p>This method will be called on delegate object when validation fails.
|
||||
- returns: No return value.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
|
|
@ -193,7 +177,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -29,15 +29,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -53,15 +44,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -243,71 +225,6 @@
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C14SwiftValidator16AlphaNumericRule"></a>
|
||||
<a name="//apple_ref/swift/Class/AlphaNumericRule" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C14SwiftValidator16AlphaNumericRule">AlphaNumericRule</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p><code>AlphaNumericRule</code> is a subclass of <code><a href="Classes/CharacterSetRule.html">CharacterSetRule</a></code>. It is used to verify that a field has a
|
||||
valid list of alphanumeric characters.</p>
|
||||
|
||||
<a href="Classes/AlphaNumericRule.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">AlphaNumericRule</span><span class="p">:</span> <span class="kt">CharacterSetRule</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C14SwiftValidator16CharacterSetRule"></a>
|
||||
<a name="//apple_ref/swift/Class/CharacterSetRule" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C14SwiftValidator16CharacterSetRule">CharacterSetRule</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p><code>CharacterSetRule</code> is a subclass of <code><a href="Protocols/Rule.html">Rule</a></code>. It is used to validate IPV4 address fields.</p>
|
||||
|
||||
<a href="Classes/CharacterSetRule.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">CharacterSetRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
|
|
@ -372,38 +289,6 @@ valid list of alphanumeric characters.</p>
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C14SwiftValidator12HexColorRule"></a>
|
||||
<a name="//apple_ref/swift/Class/HexColorRule" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C14SwiftValidator12HexColorRule">HexColorRule</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p><code>HexColorRule</code> is a subclass of <code><a href="Classes/RegexRule.html">RegexRule</a></code>. It is used to verify whether a field is a hexadecimal color.</p>
|
||||
|
||||
<a href="Classes/HexColorRule.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">HexColorRule</span><span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
|
|
@ -502,70 +387,6 @@ to another text field is validated.</p>
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C14SwiftValidator8IPV4Rule"></a>
|
||||
<a name="//apple_ref/swift/Class/IPV4Rule" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C14SwiftValidator8IPV4Rule">IPV4Rule</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p><code>IPV4Rule</code> is a subclass of RegexRule that defines how a IPV4 address validated.</p>
|
||||
|
||||
<a href="Classes/IPV4Rule.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">IPV4Rule</span><span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C14SwiftValidator8ISBNRule"></a>
|
||||
<a name="//apple_ref/swift/Class/ISBNRule" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C14SwiftValidator8ISBNRule">ISBNRule</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p><code>ISBNRule</code> is a subclass of <code><a href="Protocols/Rule.html">Rule</a></code>. It is used to verify whether a field is a valid ISBN number.</p>
|
||||
|
||||
<a href="Classes/ISBNRule.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ISBNRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
|
|
@ -662,39 +483,6 @@ to another text field is validated.</p>
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C14SwiftValidator9AlphaRule"></a>
|
||||
<a name="//apple_ref/swift/Class/AlphaRule" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C14SwiftValidator9AlphaRule">AlphaRule</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p><code>AlphaRule</code> is a subclass of <code><a href="Classes/CharacterSetRule.html">CharacterSetRule</a></code>. It is used to verify that a field has a
|
||||
valid list of alpha characters.</p>
|
||||
|
||||
<a href="Classes/AlphaRule.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">AlphaRule</span><span class="p">:</span> <span class="kt">CharacterSetRule</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
|
|
@ -794,7 +582,7 @@ valid list of alpha characters.</p>
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -1,192 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>AlphaNumericRule Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/AlphaNumericRule" class="dashAnchor"></a>
|
||||
<a title="AlphaNumericRule Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">SwiftValidator Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
AlphaNumericRule Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/EmailRule.html">EmailRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/FloatRule.html">FloatRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PasswordRule.html">PasswordRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/RegexRule.html">RegexRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/RequiredRule.html">RequiredRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ValidationError.html">ValidationError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ValidationRule.html">ValidationRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Validator.html">Validator</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/Rule.html">Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>AlphaNumericRule</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">AlphaNumericRule</span><span class="p">:</span> <span class="kt">CharacterSetRule</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p><code>AlphaNumericRule</code> is a subclass of <code><a href="../Classes/CharacterSetRule.html">CharacterSetRule</a></code>. It is used to verify that a field has a
|
||||
valid list of alphanumeric characters.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14SwiftValidator16AlphaNumericRulecFMS0_FT7messageSS_S0_"></a>
|
||||
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14SwiftValidator16AlphaNumericRulecFMS0_FT7messageSS_S0_">init(message:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes a <code><a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a></code> object to verify that field has valid set of alphanumeric characters.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Enter valid numeric characters"</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>message</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>String of error message.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,192 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>AlphaRule Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/AlphaRule" class="dashAnchor"></a>
|
||||
<a title="AlphaRule Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">SwiftValidator Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
AlphaRule Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/EmailRule.html">EmailRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/FloatRule.html">FloatRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PasswordRule.html">PasswordRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/RegexRule.html">RegexRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/RequiredRule.html">RequiredRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ValidationError.html">ValidationError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ValidationRule.html">ValidationRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Validator.html">Validator</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/Rule.html">Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>AlphaRule</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">AlphaRule</span><span class="p">:</span> <span class="kt">CharacterSetRule</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p><code>AlphaRule</code> is a subclass of <code><a href="../Classes/CharacterSetRule.html">CharacterSetRule</a></code>. It is used to verify that a field has a
|
||||
valid list of alpha characters.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14SwiftValidator9AlphaRulecFMS0_FT7messageSS_S0_"></a>
|
||||
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14SwiftValidator9AlphaRulecFMS0_FT7messageSS_S0_">init(message:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes an <code><a href="../Classes/AlphaRule.html">AlphaRule</a></code> object to verify that a field has valid set of alpha characters.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Enter valid alphabetic characters"</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>message</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>String of error message.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An initialized object, or nil if an object could not be created for some reason.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,288 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>CharacterSetRule Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/CharacterSetRule" class="dashAnchor"></a>
|
||||
<a title="CharacterSetRule Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">SwiftValidator Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
CharacterSetRule Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/EmailRule.html">EmailRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/FloatRule.html">FloatRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PasswordRule.html">PasswordRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/RegexRule.html">RegexRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/RequiredRule.html">RequiredRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ValidationError.html">ValidationError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ValidationRule.html">ValidationRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Validator.html">Validator</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/Rule.html">Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>CharacterSetRule</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">CharacterSetRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p><code>CharacterSetRule</code> is a subclass of <code><a href="../Protocols/Rule.html">Rule</a></code>. It is used to validate IPV4 address fields.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14SwiftValidator16CharacterSetRulecFMS0_FT12characterSetCSo14NSCharacterSet7messageSS_S0_"></a>
|
||||
<a name="//apple_ref/swift/Method/init(characterSet:message:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14SwiftValidator16CharacterSetRulecFMS0_FT12characterSetCSo14NSCharacterSet7messageSS_S0_">init(characterSet:message:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes a <code><a href="../Classes/CharacterSetRule.html">CharacterSetRule</a></code> object to verify that field has valid set of characters.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">characterSet</span><span class="p">:</span> <span class="kt">NSCharacterSet</span><span class="p">,</span> <span class="nv">message</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Enter valid alpha"</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>characterSet</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>NSCharacterSet that holds group of valid characters.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>message</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>String of error message.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14SwiftValidator16CharacterSetRule8validateFS0_FSSSb"></a>
|
||||
<a name="//apple_ref/swift/Method/validate(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14SwiftValidator16CharacterSetRule8validateFS0_FSSSb">validate(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Used to validate field.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="nv">value</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Bool</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>value</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>String to checked for validation.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>Boolean value. True if validation is successful; False if validation fails.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14SwiftValidator16CharacterSetRule12errorMessageFS0_FT_SS"></a>
|
||||
<a name="//apple_ref/swift/Method/errorMessage()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14SwiftValidator16CharacterSetRule12errorMessageFS0_FT_SS">errorMessage()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Displays error message when text field fails validation.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">errorMessage</span><span class="p">()</span> <span class="o">-></span> <span class="kt">String</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>String of error message.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -279,7 +261,7 @@ to another text field is validated.</p>
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -181,7 +163,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -278,7 +260,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -265,7 +247,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -265,7 +247,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -1,191 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>HexColorRule Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/HexColorRule" class="dashAnchor"></a>
|
||||
<a title="HexColorRule Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">SwiftValidator Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
HexColorRule Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/EmailRule.html">EmailRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/FloatRule.html">FloatRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PasswordRule.html">PasswordRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/RegexRule.html">RegexRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/RequiredRule.html">RequiredRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ValidationError.html">ValidationError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ValidationRule.html">ValidationRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Validator.html">Validator</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/Rule.html">Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>HexColorRule</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">HexColorRule</span><span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p><code>HexColorRule</code> is a subclass of <code><a href="../Classes/RegexRule.html">RegexRule</a></code>. It is used to verify whether a field is a hexadecimal color.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14SwiftValidator12HexColorRulecFMS0_FT7messageSS_S0_"></a>
|
||||
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14SwiftValidator12HexColorRulecFMS0_FT7messageSS_S0_">init(message:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes a <code>HexaColorRule</code> object to verify that field has text in hexadecimal color format.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Invalid regular expression"</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>message</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>String of error message.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,191 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>IPV4Rule Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/IPV4Rule" class="dashAnchor"></a>
|
||||
<a title="IPV4Rule Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">SwiftValidator Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
IPV4Rule Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/EmailRule.html">EmailRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/FloatRule.html">FloatRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PasswordRule.html">PasswordRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/RegexRule.html">RegexRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/RequiredRule.html">RequiredRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ValidationError.html">ValidationError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ValidationRule.html">ValidationRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Validator.html">Validator</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/Rule.html">Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>IPV4Rule</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">IPV4Rule</span><span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p><code>IPV4Rule</code> is a subclass of RegexRule that defines how a IPV4 address validated.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14SwiftValidator8IPV4RulecFMS0_FT7messageSS_S0_"></a>
|
||||
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14SwiftValidator8IPV4RulecFMS0_FT7messageSS_S0_">init(message:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes a <code><a href="../Classes/IPV4Rule.html">IPV4Rule</a></code> object to verify that field has text is an IPV4Rule address.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Must be a valid IPV4 address"</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>message</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>String of error message.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,275 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>ISBNRule Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/ISBNRule" class="dashAnchor"></a>
|
||||
<a title="ISBNRule Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">SwiftValidator Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
ISBNRule Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/EmailRule.html">EmailRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/FloatRule.html">FloatRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PasswordRule.html">PasswordRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/RegexRule.html">RegexRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/RequiredRule.html">RequiredRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ValidationError.html">ValidationError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ValidationRule.html">ValidationRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/Validator.html">Validator</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/Rule.html">Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>ISBNRule</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ISBNRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p><code>ISBNRule</code> is a subclass of <code><a href="../Protocols/Rule.html">Rule</a></code>. It is used to verify whether a field is a valid ISBN number.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14SwiftValidator8ISBNRulecFMS0_FT7messageSS_S0_"></a>
|
||||
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14SwiftValidator8ISBNRulecFMS0_FT7messageSS_S0_">init(message:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes a <code><a href="../Classes/ISBNRule.html">ISBNRule</a></code> object to verify that field has text that is a ISBN number.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Enter valid ISBN number"</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>message</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>String of error message.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14SwiftValidator8ISBNRule8validateFS0_FSSSb"></a>
|
||||
<a name="//apple_ref/swift/Method/validate(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14SwiftValidator8ISBNRule8validateFS0_FSSSb">validate(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Method used to validate text field.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="nv">value</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Bool</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>value</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>String to checked for validation.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>Boolean value. True if validation is successful; False if validation fails.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14SwiftValidator8ISBNRule12errorMessageFS0_FT_SS"></a>
|
||||
<a name="//apple_ref/swift/Method/errorMessage()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14SwiftValidator8ISBNRule12errorMessageFS0_FT_SS">errorMessage()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Method used to dispaly error message when text field fails validation.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">errorMessage</span><span class="p">()</span> <span class="o">-></span> <span class="kt">String</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>String of error message.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -168,7 +150,10 @@
|
|||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes a <code><a href="../Classes/MaxLengthRule.html">MaxLengthRule</a></code> object that is to validate the length of the text of a text field.</p>
|
||||
<p>Initializes a <code><a href="../Classes/MaxLengthRule.html">MaxLengthRule</a></code> object that is to validate the length of the text of a text field
|
||||
- parameter length: Maximum character length.
|
||||
- parameter message: String of error message.
|
||||
- returns: An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
|
|
@ -309,7 +294,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -168,7 +150,10 @@
|
|||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes a <code><a href="../Classes/MaxLengthRule.html">MaxLengthRule</a></code> object that is to validate the length of the text of a text field.</p>
|
||||
<p>Initializes a <code><a href="../Classes/MaxLengthRule.html">MaxLengthRule</a></code> object that is to validate the length of the text of a text field
|
||||
- parameter length: Minimum character length.
|
||||
- parameter message: String of error message.
|
||||
- returns: An initialized <code><a href="../Classes/MinLengthRule.html">MinLengthRule</a></code> object, or nil if an object could not be created for some reason that would not result in an exception.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
|
|
@ -311,7 +296,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -181,7 +163,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -137,7 +119,9 @@
|
|||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes a <code><a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a></code> object. Used to validate that a field has a valid phone number.</p>
|
||||
<p>Method used to initialize <code><a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a></code> object.
|
||||
- parameter message: Error message that is displayed if validation fails.
|
||||
- returns: An initialized <code><a href="../Classes/PasswordRule.html">PasswordRule</a></code> object, or nil if an object could not be created for some reason that would not result in an exception.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
|
|
@ -181,7 +165,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -278,7 +260,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -137,8 +119,7 @@
|
|||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes <code><a href="../Classes/RequiredRule.html">RequiredRule</a></code> object with error message. Used to validate a field that requires text.</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
|
|
@ -265,7 +246,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -218,7 +200,10 @@
|
|||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes <code><a href="../Classes/ValidationError.html">ValidationError</a></code> object with a textField and error.</p>
|
||||
<p>Initializes <code><a href="../Classes/ValidationError.html">ValidationError</a></code> object with a textField and error.
|
||||
- parameter textField: UITextField that holds textField.
|
||||
- parameter errorMessage: String that holds error message.
|
||||
- returns: An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
|
|
@ -283,7 +268,11 @@
|
|||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes <code><a href="../Classes/ValidationError.html">ValidationError</a></code> object with a textField, errorLabel, and errorMessage.</p>
|
||||
<p>Initializes ValidationError object with a textField, errorLabel, and errorMessage.
|
||||
- parameter textField: UITextField that holds textField.
|
||||
- parameter errorLabel: UILabel that holds error label.
|
||||
- parameter errorMessage: String that holds error message.
|
||||
- returns: An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
|
|
@ -353,7 +342,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -321,7 +303,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -235,7 +217,9 @@ validation fields.</p>
|
|||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>This method is used to validate a single field registered to Validator. If validation is unsuccessful,
|
||||
field gets added to errors dictionary.</p>
|
||||
field gets added to errors dictionary.
|
||||
- parameter textField: Holds validator field data.
|
||||
- returns: No return value.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
|
|
@ -634,7 +618,7 @@ field gets added to errors dictionary.</p>
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -181,7 +163,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -29,15 +29,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -53,15 +44,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -182,7 +164,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -213,7 +195,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -30,15 +30,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -54,15 +45,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="../Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -137,7 +119,8 @@
|
|||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>This method will be called on delegate object when validation is successful.</p>
|
||||
<p>This method will be called on delegate object when validation is successful.
|
||||
- returns: No return value.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
|
|
@ -169,7 +152,8 @@
|
|||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>This method will be called on delegate object when validation fails.</p>
|
||||
<p>This method will be called on delegate object when validation fails.
|
||||
- returns: No return value.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
|
|
@ -193,7 +177,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -29,15 +29,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -53,15 +44,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -113,7 +95,7 @@
|
|||
|
||||
<a href='#swiftvalidator' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='swiftvalidator'>SwiftValidator</h1>
|
||||
|
||||
<p><a href="https://travis-ci.org/jpotts18/SwiftValidator"><img src="https://travis-ci.org/jpotts18/SwiftValidator.svg?branch=travis-ci" alt="Build Status"></a> <a href="https://github.com/Carthage/Carthage"><img src="https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat" alt="Carthage compatible"></a> <a href="https://codecov.io/github/jpotts18/SwiftValidator?branch=master"><img src="https://codecov.io/github/jpotts18/SwiftValidator/coverage.svg?branch=master" alt="codecov.io"></a></p>
|
||||
<p><a href="https://travis-ci.org/jpotts18/SwiftValidator"><img src="https://travis-ci.org/jpotts18/SwiftValidator.svg?branch=travis-ci" alt="Build Status"></a> <a href="https://github.com/Carthage/Carthage"><img src="https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat" alt="Carthage compatible"></a></p>
|
||||
|
||||
<p>Swift Validator is a rule-based validation library for Swift.</p>
|
||||
|
||||
|
|
@ -201,7 +183,7 @@
|
|||
<span class="p">}</span>
|
||||
|
||||
</code></pre>
|
||||
<a href='#single_field_validation' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='single_field_validation'>Single Field Validation</h2>
|
||||
<a href='#single_field_validation' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h3 id='single_field_validation'>Single Field Validation</h3>
|
||||
|
||||
<p>You may use single field validation in some cases. This could be useful in situations such as controlling responders:</p>
|
||||
<pre class="highlight swift"><code><span class="c1">// Don't forget to use UITextFieldDelegate</span>
|
||||
|
|
@ -232,9 +214,6 @@
|
|||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</code></pre>
|
||||
<a href='#documentation' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='documentation'>Documentation</h2>
|
||||
|
||||
<p>Checkout the docs <a href="http://jpotts18.github.io/SwiftValidator/">here</a> via <a href="https://twitter.com/jazzydocs">@jazzydocs</a>.</p>
|
||||
<a href='#credits' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='credits'>Credits</h2>
|
||||
|
||||
<p>Swift Validator is written and maintained by Jeff Potter <a href="http://twitter.com/jpotts18">@jpotts18</a>.</p>
|
||||
|
|
@ -251,7 +230,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -29,15 +29,6 @@
|
|||
<li class="nav-group-name">
|
||||
<a href="Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/AlphaNumericRule.html">AlphaNumericRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/AlphaRule.html">AlphaRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/CharacterSetRule.html">CharacterSetRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/ConfirmationRule.html">ConfirmationRule</a>
|
||||
</li>
|
||||
|
|
@ -53,15 +44,6 @@
|
|||
<li class="nav-group-task">
|
||||
<a href="Classes/FullNameRule.html">FullNameRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/HexColorRule.html">HexColorRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/IPV4Rule.html">IPV4Rule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/ISBNRule.html">ISBNRule</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/MaxLengthRule.html">MaxLengthRule</a>
|
||||
</li>
|
||||
|
|
@ -113,7 +95,7 @@
|
|||
|
||||
<a href='#swiftvalidator' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='swiftvalidator'>SwiftValidator</h1>
|
||||
|
||||
<p><a href="https://travis-ci.org/jpotts18/SwiftValidator"><img src="https://travis-ci.org/jpotts18/SwiftValidator.svg?branch=travis-ci" alt="Build Status"></a> <a href="https://github.com/Carthage/Carthage"><img src="https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat" alt="Carthage compatible"></a> <a href="https://codecov.io/github/jpotts18/SwiftValidator?branch=master"><img src="https://codecov.io/github/jpotts18/SwiftValidator/coverage.svg?branch=master" alt="codecov.io"></a></p>
|
||||
<p><a href="https://travis-ci.org/jpotts18/SwiftValidator"><img src="https://travis-ci.org/jpotts18/SwiftValidator.svg?branch=travis-ci" alt="Build Status"></a> <a href="https://github.com/Carthage/Carthage"><img src="https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat" alt="Carthage compatible"></a></p>
|
||||
|
||||
<p>Swift Validator is a rule-based validation library for Swift.</p>
|
||||
|
||||
|
|
@ -201,7 +183,7 @@
|
|||
<span class="p">}</span>
|
||||
|
||||
</code></pre>
|
||||
<a href='#single_field_validation' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='single_field_validation'>Single Field Validation</h2>
|
||||
<a href='#single_field_validation' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h3 id='single_field_validation'>Single Field Validation</h3>
|
||||
|
||||
<p>You may use single field validation in some cases. This could be useful in situations such as controlling responders:</p>
|
||||
<pre class="highlight swift"><code><span class="c1">// Don't forget to use UITextFieldDelegate</span>
|
||||
|
|
@ -232,9 +214,6 @@
|
|||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</code></pre>
|
||||
<a href='#documentation' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='documentation'>Documentation</h2>
|
||||
|
||||
<p>Checkout the docs <a href="http://jpotts18.github.io/SwiftValidator/">here</a> via <a href="https://twitter.com/jazzydocs">@jazzydocs</a>.</p>
|
||||
<a href='#credits' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='credits'>Credits</h2>
|
||||
|
||||
<p>Swift Validator is written and maintained by Jeff Potter <a href="http://twitter.com/jpotts18">@jpotts18</a>.</p>
|
||||
|
|
@ -251,7 +230,7 @@
|
|||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
|
||||
<p>© 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-02-14)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
Loading…
Reference in New Issue