Compare commits

...

No commits in common. "master" and "gh-pages" have entirely different histories.

120 changed files with 1 additions and 3937 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

34
.gitignore vendored
View File

@ -1,34 +0,0 @@
.DS_Store
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
#
Pods/
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
Carthage/Checkouts
Carthage/Build

View File

@ -1,24 +0,0 @@
language: objective-c
osx_image: xcode8
xcode_sdk: iphonesimulator10.0
xcode_project: Validator.xcodeproj
xcode_scheme: Validator
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
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

View File

@ -1,21 +0,0 @@
The MIT License
Copyright (c) 2014-2015 Jeff Potter
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

178
README.md
View File

@ -1,178 +0,0 @@
SwiftValidator
===============
[![Build Status](https://travis-ci.org/SwiftValidatorCommunity/SwiftValidator.svg?branch=master)](https://travis-ci.org/SwiftValidatorCommunity/SwiftValidator) [![codecov.io](https://codecov.io/github/SwiftValidatorCommunity/SwiftValidator/coverage.svg?branch=master)](https://codecov.io/github/SwiftValidatorCommunity/SwiftValidator?branch=master)
Swift Validator is a rule-based validation library for Swift.
![Swift Validator](/swift-validator-v2.gif)
## Core Concepts
* ``UITextField`` + ``[Rule]`` + (and optional error ``UILabel``) go into ``Validator``
* ``UITextField`` + ``ValidationError`` come out of ``Validator``
* ``Validator`` evaluates ``[Rule]`` sequentially and stops evaluating when a ``Rule`` fails.
## Installation
```ruby
# Podfile
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'
```
Install into your project:
```bash
$ pod install
```
Open your project in Xcode from the .xcworkspace file (not the usual project file):
```bash
$ open MyProject.xcworkspace
```
If you are using Carthage you will need to add this to your `Cartfile`
```bash
github "jpotts18/SwiftValidator"
```
## Usage
You can now import SwiftValidator framework into your files.
Initialize the ``Validator`` by setting a delegate to a View Controller or other object.
```swift
// ViewController.swift
let validator = Validator()
```
Register the fields that you want to validate
```swift
override func viewDidLoad() {
super.viewDidLoad()
// Validation Rules are evaluated from left to right.
validator.registerField(fullNameTextField, rules: [RequiredRule(), FullNameRule()])
// You can pass in error labels with your rules
// You can pass in custom error messages to regex rules (such as ZipCodeRule and EmailRule)
validator.registerField(emailTextField, errorLabel: emailErrorLabel, rules: [RequiredRule(), EmailRule(message: "Invalid email")])
// You can validate against other fields using ConfirmRule
validator.registerField(emailConfirmTextField, errorLabel: emailConfirmErrorLabel, rules: [ConfirmationRule(confirmField: emailTextField)])
// 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}")])
// You can unregister a text field if you no longer want to validate it
validator.unregisterField(fullNameTextField)
}
```
Validate Fields on button tap or however you would like to trigger it.
```swift
@IBAction func signupTapped(sender: AnyObject) {
validator.validate(self)
}
```
Implement the Validation Delegate in your View controller
```swift
// ValidationDelegate methods
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
}
}
```
## Single Field Validation
You may use single field validation in some cases. This could be useful in situations such as controlling responders:
```swift
// Don't forget to use UITextFieldDelegate
// and delegate yourTextField to self in viewDidLoad()
func textFieldShouldReturn(textField: UITextField) -> Bool {
validator.validateField(textField){ error in
if error == nil {
// Field validation was successful
} else {
// Validation error occurred
}
}
return true
}
```
## 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.
Create a class that inherits from RegexRule
```swift
class SSNVRule: RegexRule {
static let regex = "^\\d{3}-\\d{2}-\\d{4}$"
convenience init(message : String = "Not a valid SSN"){
self.init(regex: SSNVRule.regex, message : message)
}
}
```
## Documentation
Checkout the docs <a href="http://swiftvalidatorcommunity.github.io/SwiftValidator/">here</a> via [@jazzydocs](https://twitter.com/jazzydocs).
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.
## Contributing
1. [Fork it](https://github.com/jpotts18/SwiftValidator/fork)
2. Create your feature branch `git checkout -b my-new-feature`
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%

View File

@ -1,17 +0,0 @@
Pod::Spec.new do |s|
s.name = "SwiftValidator"
s.version = "4.0.2"
s.summary = "A UITextField Validation library for Swift"
s.homepage = "https://github.com/TouchInstinct/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_files = "SwiftValidator/**/*.swift"
s.exclude_files = "Validator/AppDelegate.swift"
s.frameworks = ['Foundation', 'UIKit']
s.requires_arc = true
end

View File

@ -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 ?? ""
}
}

View File

@ -1,27 +0,0 @@
//
// ValidationDelegate.swift
// Validator
//
// Created by David Patterson on 1/2/16.
// Copyright © 2016 jpotts18. All rights reserved.
//
import Foundation
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 {
/**
This 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.
- returns: No return value.
*/
func validationFailed(_ errors: [(Validatable, ValidationError)])
}

View File

@ -1,33 +0,0 @@
//
// Created by Jeff Potter on 11/11/14.
// Copyright (c) 2015 jpotts18. All rights reserved.
//
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.
*/
public class ValidationError: NSObject {
/// the Validatable field of the field
public let field:ValidatableField
/// 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.
- 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
self.errorLabel = errorLabel
self.errorMessage = error
}
}

View File

@ -1,154 +0,0 @@
//
// Validator.swift
//
// Created by Jeff Potter on 11/10/14.
// Copyright (c) 2015 jpotts18. All rights reserved.
//
import Foundation
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>()
/// 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)?
/// Variable that holds error closure to display negative status of field.
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.
public init(){}
// MARK: Private functions
/**
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>()
for (_, rule) in validations {
if let error = rule.validateField() {
errors[rule.field] = error
// let the user transform the field if they want
if let transform = self.errorStyleTransform {
transform(error)
}
} else {
// No error
// let the user transform the field if they want
if let transform = self.successStyleTransform {
transform(rule)
}
}
}
}
// 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.
- returns: No return value.
*/
public func validateField(_ field: ValidatableField, callback: (_ error:ValidationError?) -> Void){
if let fieldRule = validations[field] {
if let error = fieldRule.validateField() {
errors[field] = error
if let transform = self.errorStyleTransform {
transform(error)
}
callback(error)
} else {
if let transform = self.successStyleTransform {
transform(fieldRule)
}
callback(nil)
}
} else {
callback(nil)
}
}
// MARK: Using Keys
/**
This method is used to style fields that have undergone validation checks. Success callback should be used to show common success styling and error callback should be used to show common error styling.
- parameter success: A closure which is called with validationRule, an object that holds validation data
- 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)?) {
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.
- 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
}
/**
This method is for removing a field validator.
- parameter field: field used to locate and remove field from validator.
- returns: No return value
*/
public func unregisterField(_ field:ValidatableField) {
validations.removeValueForKey(field)
errors.removeValueForKey(field)
}
/**
This method checks to see if all fields in validator are valid.
- returns: No return value.
*/
public func validate(_ delegate:ValidationDelegate) {
self.validateAllFields()
if errors.isEmpty {
delegate.validationSuccessful()
} else {
delegate.validationFailed(errors.map { (fields[$1.field]!, $1) })
}
}
/**
This method validates all fields in validator and sets any errors to errors parameter of callback.
- 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 {
self.validateAllFields()
callback(errors.map { (fields[$1.field]!, $1) } )
}
}

View File

@ -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()
}
}

View File

@ -1,26 +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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -1,26 +0,0 @@
//
// AlphaNumericRule.swift
// Validator
//
// Created by Bhargav Gurlanka on 2/4/16.
// Copyright © 2016 jpotts18. All rights reserved.
//
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)
}
}

View File

@ -1,26 +0,0 @@
//
// AlphaRule.swift
// Validator
//
// Created by Bhargav Gurlanka on 2/4/16.
// Copyright © 2016 jpotts18. All rights reserved.
//
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)
}
}

View File

@ -1,55 +0,0 @@
//
// CharacterSetRule.swift
// Validator
//
// Created by Bhargav Gurlanka on 2/4/16.
// Copyright © 2016 jpotts18. All rights reserved.
//
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 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") {
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 {
for uni in value.unicodeScalars {
guard let uniVal = UnicodeScalar(uni.value), characterSet.contains(uniVal) else {
return false
}
}
return true
}
/**
Displays error message when field fails validation.
- returns: String of error message.
*/
public func errorMessage() -> String {
return message
}
}

View File

@ -1,52 +0,0 @@
//
// ConfirmRule.swift
// Validator
//
// Created by Jeff Potter on 3/6/15.
// Copyright (c) 2015 jpotts18. All rights reserved.
//
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.
*/
public class ConfirmationRule: Rule {
/// parameter confirmField: field to which original text field will be compared to.
private let confirmField: ValidatableField
/// 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.
- parameter confirmField: field to which original 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"){
self.confirmField = confirmField
self.message = message
}
/**
Used to validate a 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
}
/**
Displays an error message when text field fails validation.
- returns: String of error message.
*/
public func errorMessage() -> String {
return message
}
}

View File

@ -1,27 +0,0 @@
//
// EmailValidation.swift
//
// Created by Jeff Potter on 11/11/14.
// Copyright (c) 2015 jpotts18. All rights reserved.
//
import Foundation
/**
`EmailRule` is a subclass of RegexRule that defines how a email is validated.
*/
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,}"
/**
Initializes an `EmailRule` object to validate an email 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.
*/
public convenience init(message : String = "Must be a valid email address"){
self.init(regex: EmailRule.regex, message: message)
}
}

View File

@ -1,50 +0,0 @@
//
// ExactLengthRule.swift
// Validator
//
// Created by Jeff Potter on 2/3/16.
// Copyright © 2016 jpotts18. All rights reserved.
//
import Foundation
/**
`ExactLengthRule` is a subclass of Rule that is used to make sure a the text of a field is an exact length.
*/
public class ExactLengthRule : Rule {
/// parameter message: String of error message.
private var message : String = "Must be at most 16 characters long"
/// parameter length: Integer value string length
private var length : Int
/**
Initializes an `ExactLengthRule` object to validate the text of a field against an exact length.
- parameter length: Integer value of exact string length being specified.
- parameter message: String of error message.
- returns: An initialized `ExactLengthRule` 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 exactly %ld characters long"){
self.length = length
self.message = String(format: message, self.length)
}
/**
Used to validate a 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
}
/**
Displays error message if a field fails validation.
- returns: String of error message.
*/
public func errorMessage() -> String {
return message
}
}

View File

@ -1,51 +0,0 @@
//
// FloatRule.swift
// Validator
//
// Created by Cameron McCord on 5/5/15.
// Copyright (c) 2015 jpotts18. All rights reserved.
//
import Foundation
/**
`FloatRule` is a subclass of Rule that defines how check if a value is a floating point value.
*/
public class FloatRule:Rule {
/// Error message to be displayed if validation fails.
private var message : String
/**
Initializes a `FloatRule` object to validate that the text of a 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.
*/
public init(message : String = "This must be a number with or without a decimal"){
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 {
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))
return match == 1
}
return false
}
/**
Displays error message when field fails validation.
- returns: String of error message.
*/
public func errorMessage() -> String {
return message
}
}

View File

@ -1,46 +0,0 @@
//
// FullNameValidation.swift
//
// Created by Jeff Potter on 11/19/14.
// Copyright (c) 2015 jpotts18. All rights reserved.
//
import Foundation
/**
`FullNameRule` is a subclass of Rule that defines how a full name is validated.
*/
public class FullNameRule : Rule {
/// Error message to be displayed if validation fails.
private var message : String
/**
Initializes a `FullNameRule` object that is used to verify that text in 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.
*/
public init(message : String = "Please provide a first & last name"){
self.message = message
}
/**
Used to validate a 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) }
return nameArray.count >= 2
}
/**
Used to display error message of a field that has failed validation.
- returns: String of error message.
*/
public func errorMessage() -> String {
return message
}
}

View File

@ -1,27 +0,0 @@
//
// HexColorRule.swift
// Validator
//
// Created by Bhargav Gurlanka on 2/4/16.
// Copyright © 2016 jpotts18. All rights reserved.
//
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)
}
}

View File

@ -1,27 +0,0 @@
//
// IPV4Rule.swift
// Validator
//
// Created by Bhargav Gurlanka on 2/4/16.
// Copyright © 2016 jpotts18. All rights reserved.
//
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.
*/
public init(message: String = "Must be a valid IPV4 address") {
super.init(regex: IPV4Rule.regex, message: message)
}
}

View File

@ -1,191 +0,0 @@
//
// ISBNRule.swift
// Validator
//
// Created by Bhargav Gurlanka on 2/4/16.
// Copyright © 2016 jpotts18. All rights reserved.
//
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 {
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: "")
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
}
/**
`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 {
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 {
return false
}
return true
}
}
/**
`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 {
var checksum = 0
for i in 0..<9 {
if let intCharacter = Int(String(input[input.index(input.startIndex, offsetBy: i)])) {
checksum += (i + 1) * intCharacter
}
}
if (input[input.index(input.startIndex, offsetBy: 9)] == "X") {
checksum += 10 * 10
} else {
if let intCharacter = Int(String(input[input.index(input.startIndex, offsetBy: 9)])) {
checksum += 10 * intCharacter
}
}
return ((checksum % 11) == 0)
}
}
/**
`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 {
let factor = [1, 3]
var checksum = 0
for i in 0..<12 {
if let intCharacter = Int(String(input[input.index(input.startIndex, offsetBy: i)])) {
print("\(factor[i%2]) * \(intCharacter)")
checksum += factor[i % 2] * intCharacter
}
}
if let lastInt = Int(String(input[input.index(input.startIndex, offsetBy: 12)])) {
return (lastInt - ((10 - (checksum % 10)) % 10) == 0)
}
return false
}
}

View File

@ -1,51 +0,0 @@
//
// MaxLengthRule.swift
// Validator
//
// Created by Guilherme Berger on 4/6/15.
//
import Foundation
/**
`MaxLengthRule` is a subclass of `Rule` that defines how maximum character length is validated.
*/
public class MaxLengthRule: Rule {
/// Default maximum character length.
private var DEFAULT_LENGTH: Int = 16
/// Error message to be displayed if validation fails.
private var message : String = "Must be at most 16 characters long"
/// - returns: An initialized `MaxLengthRule` object, or nil if an object could not be created for some reason that would not result in an exception.
public init(){}
/**
Initializes a `MaxLengthRule` object that is to validate the length of the text of a 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)
}
/**
Used to validate a 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
}
/**
Displays an error message if a field fails validation.
- returns: String of error message.
*/
public func errorMessage() -> String {
return message
}
}

View File

@ -1,52 +0,0 @@
//
// LengthRule.swift
// Validator
//
// Created by Jeff Potter on 3/6/15.
// Copyright (c) 2015 jpotts18. All rights reserved.
//
import Foundation
/**
`MinLengthRule` is a subclass of Rule that defines how minimum character length is validated.
*/
public class MinLengthRule: Rule {
/// Default minimum character length.
private var DEFAULT_LENGTH: Int = 3
/// Default error message to be displayed if validation fails.
private var message : String = "Must be at least 3 characters long"
/// - 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(){}
/**
Initializes a `MaxLengthRule` object that is to validate the length of the text of a 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)
}
/**
Validates a 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
}
/**
Displays error message when field has failed validation.
- returns: String of error message.
*/
public func errorMessage() -> String {
return message
}
}

View File

@ -1,35 +0,0 @@
//
// PasswordValidation.swift
//
// Created by Jeff Potter on 11/13/14.
// Copyright (c) 2015 jpotts18. All rights reserved.
//
import Foundation
/**
`PasswordRule` is a subclass of RegexRule that defines how a password is validated.
*/
public class PasswordRule : RegexRule {
// Alternative Regexes
// 8 characters. One uppercase. One Lowercase. One number.
// static let regex = "^(?=.*?[A-Z])(?=.*?[0-9])(?=.*?[a-z]).{8,}$"
//
// no length. One uppercase. One lowercae. One number.
// static let regex = "^(?=.*?[A-Z])(?=.*?[0-9])(?=.*?[a-z]).*?$"
/// Regular express string to be used in validation.
static let regex = "^(?=.*?[A-Z]).{8,}$"
/**
Initializes a `PasswordRule` object that will validate a 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.
*/
public convenience init(message : String = "Must be 8 characters with 1 uppercase") {
self.init(regex: PasswordRule.regex, message : message)
}
}

View File

@ -1,29 +0,0 @@
//
// PhoneValidation.swift
//
// Created by Jeff Potter on 11/11/14.
// Copyright (c) 2014 Byron Mackay. All rights reserved.
//
import Foundation
/**
`PhoneNumberRule` is a subclass of Rule that defines how a phone number is validated.
*/
public class PhoneNumberRule: RegexRule {
// let PHONE_REGEX = "^\\d{3}-\\d{3}-\\d{4}$"
/// Phone number regular express string to be used in validation.
static let regex = "^\\d{10}$"
/**
Initializes a `PhoneNumberRule` object. Used to validate that a field has a valid phone number.
- 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.
*/
public convenience init(message : String = "Enter a valid 10 digit phone number") {
self.init(regex: PhoneNumberRule.regex, message : message)
}
}

View File

@ -1,51 +0,0 @@
//
// RegexRule.swift
// Validator
//
// Created by Jeff Potter on 4/3/15.
// Copyright (c) 2015 jpotts18. All rights reserved.
//
import Foundation
/**
`RegexRule` is a subclass of Rule that defines how a regular expression is validated.
*/
open class RegexRule : Rule {
/// Regular express string to be used in validation.
private var REGEX: String = "^(?=.*?[A-Z]).{8,}$"
/// String that holds error message.
private var message : String
/**
Method used to initialize `RegexRule` object.
- parameter regex: Regular expression string to be used in validation.
- parameter message: String of error message.
- returns: An initialized `RegexRule` object, or nil if an object could not be created for some reason that would not result in an exception.
*/
public init(regex: String, message: String = "Invalid Regular Expression"){
self.REGEX = regex
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.
*/
open func validate(_ value: String) -> Bool {
let test = NSPredicate(format: "SELF MATCHES %@", self.REGEX)
return test.evaluate(with: value)
}
/**
Method used to dispaly error message when field fails validation.
- returns: String of error message.
*/
open func errorMessage() -> String {
return message
}
}

View File

@ -1,46 +0,0 @@
//
// Required.swift
// pyur-ios
//
// Created by Jeff Potter on 12/22/14.
// Copyright (c) 2015 jpotts18. All rights reserved.
//
import Foundation
/**
`RequiredRule` is a subclass of Rule that defines how a required field is validated.
*/
open 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.
*/
public init(message : String = "This field is required"){
self.message = message
}
/**
Validates a 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 {
return !value.isEmpty
}
/**
Used to display error message when validation fails.
- returns: String of error message.
*/
open func errorMessage() -> String {
return message
}
}

View File

@ -1,27 +0,0 @@
//
// Validation.swift
//
// Created by Jeff Potter on 11/11/14.
// Copyright (c) 2015 jpotts18. All rights reserved.
//
import Foundation
/**
The `Rule` protocol declares the required methods for all objects that subscribe to it.
*/
public protocol Rule {
/**
Validates text of a 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
/**
Displays error message of a field that has failed validation.
- returns: String of error message.
*/
func errorMessage() -> String
}

View File

@ -1,45 +0,0 @@
//
// ValidationRule.swift
//
// Created by Jeff Potter on 11/11/14.
// Copyright (c) 2015 jpotts18. All rights reserved.
//
import Foundation
import UIKit
/**
`ValidationRule` is a class that creates an object which holds validation info of a field.
*/
public class ValidationRule {
/// the field of the field
public var field:ValidatableField
/// the errorLabel of the field
public var errorLabel:UILabel?
/// the rules of the field
public var rules:[Rule] = []
/**
Initializes `ValidationRule` instance with 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.
- 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
self.errorLabel = errorLabel
self.rules = rules
}
/**
Used to validate 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
}
}

View File

@ -1,24 +0,0 @@
//
// ZipCodeRule.swift
// Validator
//
// Created by Jeff Potter on 3/6/15.
// Copyright (c) 2015 jpotts18. All rights reserved.
//
import Foundation
/**
`ZipCodeRule` is a subclass of `RegexRule` that represents how zip codes are to be validated.
*/
public class ZipCodeRule: RegexRule {
/**
Initializes a `ZipCodeRule` object.
- parameter message: 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 convenience init(message : String = "Enter a valid 5 digit zipcode"){
self.init(regex: "\\d{5}", message : message)
}
}

View File

@ -1,19 +0,0 @@
//
// SwiftValidator.h
// SwiftValidator
//
// Created by Rusty Zarse on 9/3/15.
// Copyright (c) 2015 jpotts18. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for SwiftValidator.
FOUNDATION_EXPORT double SwiftValidatorVersionNumber;
//! Project version string for SwiftValidator.
FOUNDATION_EXPORT const unsigned char SwiftValidatorVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <SwiftValidator/PublicHeader.h>

View File

@ -1,24 +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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

View File

@ -1,433 +0,0 @@
//
// SwiftValidatorTests.swift
// SwiftValidatorTests
//
// Created by Jeff Potter on 11/20/14.
// Copyright (c) 2014 jpotts18. All rights reserved.
//
import UIKit
import XCTest
import Validator // example app
import SwiftValidator // framework
class SwiftValidatorTests: XCTestCase {
let USERNAME_REGEX = "^[a-z0-9_-]{3,16}$"
let VALID_ZIP = "12345"
let INVALID_ZIP = "1234"
let VALID_EMAIL = "jiggy@gmail.com"
let INVALID_EMAIL = "This is not a valid email"
let CONFIRM_TXT_FIELD = UITextField()
let CONFIRM_TEXT = "Confirm this!"
let CONFIRM_TEXT_DIFF = "I am not the same as the string above"
let VALID_PASSWORD = "Super$ecret"
let INVALID_PASSWORD = "abc"
let VALID_FLOAT = "1234.444"
let INVALID_FLOAT = "1234.44.44"
let LEN_3 = "hey"
let LEN_5 = "Howdy"
let LEN_20 = "Paint the cat orange"
let REGISTER_TXT_FIELD = UITextField()
let REGISTER_VALIDATOR = Validator()
let REGISTER_RULES = [Rule]()
let UNREGISTER_TXT_FIELD = UITextField()
let UNREGISTER_VALIDATOR = Validator()
let UNREGISTER_RULES = [Rule]()
let UNREGISTER_ERRORS_TXT_FIELD = UITextField()
let UNREGISTER_ERRORS_VALIDATOR = Validator()
let ERROR_LABEL = UILabel()
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
// MARK: Required
func testRequired() {
XCTAssertTrue(RequiredRule().validate("Something"), "Required should be valid")
}
func testRequiredInvalid() {
XCTAssertFalse(RequiredRule().validate(""), "Required should be invalid")
}
func testRequiredMessage() {
XCTAssertNotNil(RequiredRule().errorMessage())
}
// MARK: Regex
func testRegex(){
XCTAssertTrue(RegexRule(regex: USERNAME_REGEX).validate("darth_vader8"), "RegexRule should be valid")
}
func testRegexInvalid(){
XCTAssertFalse(RegexRule(regex: USERNAME_REGEX).validate("DarthVader"), "RegexRule should be invalid")
}
func testRegexMessage() {
XCTAssertNotNil(RegexRule(regex: USERNAME_REGEX).errorMessage())
}
// MARK: Zipcode
func testZipCode() {
XCTAssertTrue(ZipCodeRule().validate(VALID_ZIP), "Zipcode should be valid")
}
func testZipCodeInvalid() {
XCTAssertFalse(ZipCodeRule().validate(INVALID_ZIP), "Zipcode should be invalid")
}
func testZipCodeMessage() {
XCTAssertNotNil(ZipCodeRule().errorMessage())
}
// MARK: Email
func testEmail() {
XCTAssertTrue(EmailRule().validate(VALID_EMAIL), "Email should be valid")
}
func testEmailInvalid() {
XCTAssertFalse(EmailRule().validate(INVALID_EMAIL), "Email should be invalid")
}
func testEmailMessage() {
XCTAssertNotNil(EmailRule().errorMessage())
}
// MARK: Float
func testFloat() {
XCTAssert(FloatRule().validate(VALID_FLOAT), "Float should be valid")
}
func testFloatInvalid() {
XCTAssert(!FloatRule().validate(INVALID_FLOAT), "Float should be invalid")
XCTAssert(!FloatRule().validate(VALID_EMAIL), "Float should be invalid")
}
func testFloatMessage() {
XCTAssertNotNil(FloatRule().errorMessage())
}
// MARK: Confirm against field
func testConfirmSame(){
CONFIRM_TXT_FIELD.text = CONFIRM_TEXT
XCTAssertTrue(ConfirmationRule(confirmField: CONFIRM_TXT_FIELD).validate(CONFIRM_TEXT), "Should confirm successfully")
}
func testConfirmDifferent() {
CONFIRM_TXT_FIELD.text = CONFIRM_TEXT
XCTAssertFalse(ConfirmationRule(confirmField: CONFIRM_TXT_FIELD).validate(CONFIRM_TEXT_DIFF), "Should fail confirm")
}
func testConfirmMessage() {
CONFIRM_TXT_FIELD.text = CONFIRM_TEXT
XCTAssertNotNil(ConfirmationRule(confirmField: CONFIRM_TXT_FIELD).errorMessage())
}
// MARK: Password
func testPassword() {
XCTAssertTrue(PasswordRule().validate(VALID_PASSWORD), "Password should be valid")
}
func testPasswordInvalid(){
XCTAssertFalse(PasswordRule().validate(INVALID_PASSWORD), "Password is invalid")
}
func testPasswordMessage() {
XCTAssertNotNil(PasswordRule().errorMessage())
}
func testPhoneNumber() {
XCTAssertTrue(PhoneNumberRule().validate("1234567890"), "Phone number should valid")
}
func testPhoneNumberInvalid() {
XCTAssertFalse(PhoneNumberRule().validate("12345678901"), "Phone number should be invalid")
}
func testPhoneNumberMessage() {
XCTAssertNotNil(PhoneNumberRule().errorMessage())
}
// MARK: Max Length
func testMaxLength(){
XCTAssertTrue(MaxLengthRule().validate(LEN_3),"Max Length should be valid")
}
func testMaxLengthInvalid(){
XCTAssertFalse(MaxLengthRule().validate(LEN_20),"Max Length should be invalid")
}
func testMaxLengthParameterAndGreaterThan(){
XCTAssertTrue(MaxLengthRule(length: 20).validate(LEN_20), "Max Length should be 20 and <= length")
}
func testMaxLengthMessage() {
XCTAssertNotNil(MaxLengthRule(length: 20).errorMessage())
}
// MARK: Min Length
func testMinLength(){
XCTAssertTrue(MinLengthRule().validate(LEN_3),"Min Length should be valid")
}
func testMinLengthInvalid(){
XCTAssertFalse(MinLengthRule().validate("no"),"Min Length should be Invalid")
}
func testMinLengthWithParameter(){
XCTAssertTrue(MinLengthRule(length: 5).validate(LEN_5), "Min Len should be set to 5 and >= length")
}
func testMinLengthMessage() {
XCTAssertNotNil(MinLengthRule(length: 5).errorMessage())
}
func testExactLength(){
XCTAssertTrue(ExactLengthRule(length: 5).validate(LEN_5), "Exact Len should be exactly 5")
}
func testExactLengthInvalidGreaterThan(){
XCTAssertFalse(ExactLengthRule(length: 6).validate(LEN_5), "Exact Len should be Invalid")
}
func testExactLengthInvalidLessThan(){
XCTAssertFalse(ExactLengthRule(length: 4).validate(LEN_5), "Exact Len should be Invalid")
}
func testExactLengthMessage() {
XCTAssertNotNil(ExactLengthRule(length: 4).errorMessage())
}
// MARK: Full Name
func testFullName(){
XCTAssertTrue(FullNameRule().validate("Jeff Potter"), "Full Name should be valid")
}
func testFullNameWith3Names(){
XCTAssertTrue(FullNameRule().validate("Jeff Van Buren"), "Full Name should be valid")
}
func testFullNameInvalid(){
XCTAssertFalse(FullNameRule().validate("Carl"), "Full Name should be invalid")
}
// MARK: ISBN
func testValidISBN10() {
let validISBN10 = ["3836221195", "3-8362-2119-5", "3 8362 2119 5" , "1617290858", "1-61729-085-8", "1 61729 085-8" , "0007269706", "0-00-726970-6", "0 00 726970 6" , "3423214120", "3-423-21412-0", "3 423 21412 0", "340101319X", "3-401-01319-X", "3 401 01319 X"]
for ISBN10 in validISBN10 {
XCTAssertTrue(ISBNRule().validate(ISBN10), "\(ISBN10) should be valid")
}
}
func testInvalidISBN10() {
let invalidISBN10 = ["3423214121", "3-423-21412-1", "3 423 21412 1"]
for ISBN10 in invalidISBN10 {
XCTAssertFalse(ISBNRule().validate(ISBN10), "\(ISBN10) should be invalid")
}
}
// MARK: HexColor
func testValidHexColors() {
let validHexes = ["#ff0034", "#CCCCCC", "fff", "#f00"]
for hex in validHexes {
XCTAssertTrue(HexColorRule().validate(hex), "\(hex) should be a valid Hex")
}
}
func testInvalidHexColors() {
let validHexes = ["#ff", "fff0", "#ff12FG", ""]
for hex in validHexes {
XCTAssertFalse(HexColorRule().validate(hex), "\(hex) should be invalid Hex")
}
}
//MARK: IPV4
func testValidIPV4() {
let validIPV4 = ["127.0.0.1" , "0.0.0.0" , "255.255.255.255" , "1.2.3.4"]
for ipv4 in validIPV4 {
XCTAssertTrue(IPV4Rule().validate(ipv4), "\(ipv4) should be a valid IPV4 address")
}
}
func testInvalidIPV4() {
let invalidIPV4 = ["::1" , "2001:db8:0000:1:1:1:1:1" , "::ffff:127.0.0.1"]
for ipv4 in invalidIPV4 {
XCTAssertFalse(IPV4Rule().validate(ipv4), "\(ipv4) should be invalid IPV4 address")
}
}
//MARK: AlphaNumeric
func testValidAlphaNumeric() {
let validAlphaNumeric = ["abc123", "A1B2C35555"]
for alphaNum in validAlphaNumeric {
XCTAssertTrue(AlphaNumericRule().validate(alphaNum), "\(alphaNum) should be a valid alpha numeric string")
}
}
func testInvalidAlphaNumeric() {
let invalidAlphaNumeric = ["abc ", "!!!!!", "ABC@DAGQW%!^$@%"]
for alphaNum in invalidAlphaNumeric {
XCTAssertFalse(AlphaNumericRule().validate(alphaNum), "\(alphaNum) should be invalid alpha numeric string")
}
}
//MARK: Alpha
func testValidAlpha() {
let validAlphaStrings = ["abc", "ABCDEFG", "AabeVsDvaW"]
for alpha in validAlphaStrings {
XCTAssertTrue(AlphaRule().validate(alpha), "\(alpha) should be valid alpha string")
}
}
func testInvalidAlpha() {
let invalidAlphaStrings = ["abc1", " foo "]
for alpha in invalidAlphaStrings {
XCTAssertFalse(AlphaRule().validate(alpha), "\(alpha) should be invalid alpha string")
}
}
// MARK: Register Field
func testRegisterField(){
REGISTER_VALIDATOR.registerField(REGISTER_TXT_FIELD, rules: REGISTER_RULES)
XCTAssert(REGISTER_VALIDATOR.validations[REGISTER_TXT_FIELD] != nil, "Textfield should register")
}
func testUnregisterField(){
UNREGISTER_VALIDATOR.registerField(UNREGISTER_TXT_FIELD, rules: UNREGISTER_RULES)
UNREGISTER_VALIDATOR.unregisterField(UNREGISTER_TXT_FIELD)
XCTAssert(UNREGISTER_VALIDATOR.validations[UNREGISTER_TXT_FIELD] == nil, "Textfield should unregister")
}
func testUnregisterError(){
UNREGISTER_ERRORS_VALIDATOR.registerField(UNREGISTER_ERRORS_TXT_FIELD, rules: [EmailRule()])
UNREGISTER_ERRORS_TXT_FIELD.text = INVALID_EMAIL
UNREGISTER_ERRORS_VALIDATOR.validate { (errors) -> Void in
XCTAssert(errors.count == 1, "Should come back with errors")
}
UNREGISTER_ERRORS_VALIDATOR.unregisterField(UNREGISTER_ERRORS_TXT_FIELD)
UNREGISTER_ERRORS_VALIDATOR.validate { (errors) -> Void in
XCTAssert(errors.count == 0, "Should not come back with errors")
}
}
// MARK: Validate Functions
func testValidateWithCallback() {
REGISTER_VALIDATOR.registerField(REGISTER_TXT_FIELD, rules: [EmailRule()])
REGISTER_TXT_FIELD.text = VALID_EMAIL
REGISTER_VALIDATOR.validate { (errors) -> Void in
XCTAssert(errors.count == 0, "Should not come back with errors")
}
REGISTER_TXT_FIELD.text = INVALID_EMAIL
REGISTER_VALIDATOR.validate { (errors) -> Void in
XCTAssert(errors.count == 1, "Should come back with 1 error")
}
}
func testValidateSingleField() {
REGISTER_VALIDATOR.registerField(REGISTER_TXT_FIELD, rules: [EmailRule()])
REGISTER_TXT_FIELD.text = VALID_EMAIL
REGISTER_VALIDATOR.validateField(REGISTER_TXT_FIELD) { error in
XCTAssert(error == nil, "Should not present error")
}
REGISTER_TXT_FIELD.text = INVALID_EMAIL
REGISTER_VALIDATOR.validateField(REGISTER_TXT_FIELD) { error in
XCTAssert(error?.errorMessage.count ?? 0 > 0, "Should state 'invalid email'")
}
}
// MARK: Validate error field gets it's text set to the error, if supplied
func testNoErrorMessageSet() {
REGISTER_VALIDATOR.registerField(REGISTER_TXT_FIELD, errorLabel: ERROR_LABEL, rules: [EmailRule()])
REGISTER_TXT_FIELD.text = VALID_EMAIL
REGISTER_VALIDATOR.validate { (errors) -> Void in
XCTAssert(errors.count == 0, "Should not come back with errors")
}
}
func testErrorMessageSet() {
REGISTER_VALIDATOR.registerField(REGISTER_TXT_FIELD, errorLabel: ERROR_LABEL, rules: [EmailRule()])
var successCount = 0
var errorCount = 0
REGISTER_VALIDATOR.styleTransformers(success: { (validationRule) -> Void in
successCount+=1
}) { (validationError) -> Void in
errorCount+=1
}
REGISTER_TXT_FIELD.text = INVALID_EMAIL
REGISTER_VALIDATOR.validate { (errors) -> Void in
XCTAssert(errors.count == 1, "Should come back with errors")
XCTAssert(errorCount == 1, "Should have called the error style transform once")
XCTAssert(successCount == 0, "Should not have called the success style transform as there are no successful fields")
}
}
func testErrorMessageSetAndThenUnset() {
REGISTER_VALIDATOR.registerField(REGISTER_TXT_FIELD, errorLabel: ERROR_LABEL, rules: [EmailRule()])
var successCount = 0
var errorCount = 0
REGISTER_VALIDATOR.styleTransformers(success: { (validationRule) -> Void in
successCount+=1
}) { (validationError) -> Void in
errorCount+=1
}
REGISTER_TXT_FIELD.text = INVALID_EMAIL
REGISTER_VALIDATOR.validate { (errors) -> Void in
XCTAssert(errors.count == 1, "Should come back with errors")
XCTAssert(errorCount == 1, "Should have called the error style transform once")
XCTAssert(successCount == 0, "Should not have called the success style transform as there are no successful fields")
self.REGISTER_TXT_FIELD.text = self.VALID_EMAIL
self.REGISTER_VALIDATOR.validate { (errors) -> Void in
XCTAssert(errors.count == 0, "Should not come back with errors: \(errors)")
XCTAssert(successCount == 1, "Should have called the success style transform once")
XCTAssert(errorCount == 1, "Should not have called the error style transform again")
}
}
}
func testTextFieldBorderColorNotSet() {
REGISTER_VALIDATOR.registerField(REGISTER_TXT_FIELD, errorLabel: ERROR_LABEL, rules: [EmailRule()])
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")
}
}
}

View File

@ -1,886 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
62C1821D1C6312F5003788E7 /* ExactLengthRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62C1821C1C6312F5003788E7 /* ExactLengthRule.swift */; };
62D1AE1D1A1E6D4400E4DFF8 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62D1AE1C1A1E6D4400E4DFF8 /* AppDelegate.swift */; };
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 */; };
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 */; };
7CC1E4D51C637C8500AF013C /* IPV4Rule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CC1E4D41C637C8500AF013C /* IPV4Rule.swift */; };
7CC1E4D71C637F6E00AF013C /* ISBNRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CC1E4D61C637F6E00AF013C /* ISBNRule.swift */; };
7CC1E4DB1C63BFA600AF013C /* HexColorRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CC1E4DA1C63BFA600AF013C /* HexColorRule.swift */; };
FB465CB81B9884F400398388 /* SwiftValidator.h in Headers */ = {isa = PBXBuildFile; fileRef = FB465CB71B9884F400398388 /* SwiftValidator.h */; settings = {ATTRIBUTES = (Public, ); }; };
FB465CBE1B9884F400398388 /* SwiftValidator.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB465CB31B9884F400398388 /* SwiftValidator.framework */; };
FB465CC71B9884F400398388 /* SwiftValidatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB465CC61B9884F400398388 /* SwiftValidatorTests.swift */; };
FB465CCA1B9884F400398388 /* SwiftValidator.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB465CB31B9884F400398388 /* SwiftValidator.framework */; };
FB465CCB1B9884F400398388 /* SwiftValidator.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = FB465CB31B9884F400398388 /* SwiftValidator.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
FB465CE11B98854100398388 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62D1AE1E1A1E6D4400E4DFF8 /* ViewController.swift */; };
FB465CF31B9889EA00398388 /* ConfirmRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB465CE31B9889EA00398388 /* ConfirmRule.swift */; };
FB465CF41B9889EA00398388 /* EmailRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB465CE41B9889EA00398388 /* EmailRule.swift */; };
FB465CF51B9889EA00398388 /* FloatRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB465CE51B9889EA00398388 /* FloatRule.swift */; };
FB465CF61B9889EA00398388 /* FullNameRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB465CE61B9889EA00398388 /* FullNameRule.swift */; };
FB465CF71B9889EA00398388 /* MaxLengthRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB465CE71B9889EA00398388 /* MaxLengthRule.swift */; };
FB465CF81B9889EA00398388 /* MinLengthRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB465CE81B9889EA00398388 /* MinLengthRule.swift */; };
FB465CF91B9889EA00398388 /* PasswordRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB465CE91B9889EA00398388 /* PasswordRule.swift */; };
FB465CFA1B9889EA00398388 /* PhoneNumberRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB465CEA1B9889EA00398388 /* PhoneNumberRule.swift */; };
FB465CFB1B9889EA00398388 /* RegexRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB465CEB1B9889EA00398388 /* RegexRule.swift */; };
FB465CFC1B9889EA00398388 /* RequiredRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB465CEC1B9889EA00398388 /* RequiredRule.swift */; };
FB465CFD1B9889EA00398388 /* Rule.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB465CED1B9889EA00398388 /* Rule.swift */; };
FB465CFE1B9889EA00398388 /* ValidationRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB465CEE1B9889EA00398388 /* ValidationRule.swift */; };
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 */
62D1AE2D1A1E6D4500E4DFF8 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 62D1AE0F1A1E6D4400E4DFF8 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 62D1AE161A1E6D4400E4DFF8;
remoteInfo = Validator;
};
FB465CBF1B9884F400398388 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 62D1AE0F1A1E6D4400E4DFF8 /* Project object */;
proxyType = 1;
remoteGlobalIDString = FB465CB21B9884F400398388;
remoteInfo = SwiftValidator;
};
FB465CC11B9884F400398388 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 62D1AE0F1A1E6D4400E4DFF8 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 62D1AE161A1E6D4400E4DFF8;
remoteInfo = Validator;
};
FB465CC81B9884F400398388 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 62D1AE0F1A1E6D4400E4DFF8 /* Project object */;
proxyType = 1;
remoteGlobalIDString = FB465CB21B9884F400398388;
remoteInfo = SwiftValidator;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
FB465CD11B9884F400398388 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
FB465CCB1B9884F400398388 /* SwiftValidator.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
62C1821C1C6312F5003788E7 /* ExactLengthRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExactLengthRule.swift; sourceTree = "<group>"; };
62D1AE171A1E6D4400E4DFF8 /* Validator.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Validator.app; sourceTree = BUILT_PRODUCTS_DIR; };
62D1AE1B1A1E6D4400E4DFF8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
62D1AE1C1A1E6D4400E4DFF8 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
62D1AE1E1A1E6D4400E4DFF8 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
62D1AE211A1E6D4400E4DFF8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
62D1AE231A1E6D4400E4DFF8 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
62D1AE261A1E6D4400E4DFF8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
62D1AE2C1A1E6D4500E4DFF8 /* ValidatorTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ValidatorTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
62D1AE311A1E6D4500E4DFF8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
62D9B2551C7C0B2A00BAFCE3 /* ValidationDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValidationDelegate.swift; sourceTree = "<group>"; };
7CC1E4CE1C636B4500AF013C /* AlphaRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlphaRule.swift; sourceTree = "<group>"; };
7CC1E4D01C637A7700AF013C /* AlphaNumericRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlphaNumericRule.swift; sourceTree = "<group>"; };
7CC1E4D21C637ABC00AF013C /* CharacterSetRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CharacterSetRule.swift; sourceTree = "<group>"; };
7CC1E4D41C637C8500AF013C /* IPV4Rule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IPV4Rule.swift; sourceTree = "<group>"; };
7CC1E4D61C637F6E00AF013C /* ISBNRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ISBNRule.swift; sourceTree = "<group>"; };
7CC1E4DA1C63BFA600AF013C /* HexColorRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HexColorRule.swift; sourceTree = "<group>"; };
FB465CB31B9884F400398388 /* SwiftValidator.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftValidator.framework; sourceTree = BUILT_PRODUCTS_DIR; };
FB465CB61B9884F400398388 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
FB465CB71B9884F400398388 /* SwiftValidator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SwiftValidator.h; sourceTree = "<group>"; };
FB465CBD1B9884F400398388 /* SwiftValidatorTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwiftValidatorTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
FB465CC51B9884F400398388 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
FB465CC61B9884F400398388 /* SwiftValidatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftValidatorTests.swift; sourceTree = "<group>"; };
FB465CE31B9889EA00398388 /* ConfirmRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConfirmRule.swift; sourceTree = "<group>"; };
FB465CE41B9889EA00398388 /* EmailRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EmailRule.swift; sourceTree = "<group>"; };
FB465CE51B9889EA00398388 /* FloatRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FloatRule.swift; sourceTree = "<group>"; };
FB465CE61B9889EA00398388 /* FullNameRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FullNameRule.swift; sourceTree = "<group>"; };
FB465CE71B9889EA00398388 /* MaxLengthRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaxLengthRule.swift; sourceTree = "<group>"; };
FB465CE81B9889EA00398388 /* MinLengthRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MinLengthRule.swift; sourceTree = "<group>"; };
FB465CE91B9889EA00398388 /* PasswordRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PasswordRule.swift; sourceTree = "<group>"; };
FB465CEA1B9889EA00398388 /* PhoneNumberRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhoneNumberRule.swift; sourceTree = "<group>"; };
FB465CEB1B9889EA00398388 /* RegexRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RegexRule.swift; sourceTree = "<group>"; };
FB465CEC1B9889EA00398388 /* RequiredRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RequiredRule.swift; sourceTree = "<group>"; };
FB465CED1B9889EA00398388 /* Rule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Rule.swift; sourceTree = "<group>"; };
FB465CEE1B9889EA00398388 /* ValidationRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValidationRule.swift; sourceTree = "<group>"; };
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 */
62D1AE141A1E6D4400E4DFF8 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FB465CCA1B9884F400398388 /* SwiftValidator.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
62D1AE291A1E6D4500E4DFF8 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
FB465CAF1B9884F400398388 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
FB465CBA1B9884F400398388 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FB465CBE1B9884F400398388 /* SwiftValidator.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
62D1AE0E1A1E6D4400E4DFF8 = {
isa = PBXGroup;
children = (
62D1AE191A1E6D4400E4DFF8 /* Validator */,
62D1AE2F1A1E6D4500E4DFF8 /* ValidatorTests */,
FB465CB41B9884F400398388 /* SwiftValidator */,
FB465CC31B9884F400398388 /* SwiftValidatorTests */,
62D1AE181A1E6D4400E4DFF8 /* Products */,
);
sourceTree = "<group>";
};
62D1AE181A1E6D4400E4DFF8 /* Products */ = {
isa = PBXGroup;
children = (
62D1AE171A1E6D4400E4DFF8 /* Validator.app */,
62D1AE2C1A1E6D4500E4DFF8 /* ValidatorTests.xctest */,
FB465CB31B9884F400398388 /* SwiftValidator.framework */,
FB465CBD1B9884F400398388 /* SwiftValidatorTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
62D1AE191A1E6D4400E4DFF8 /* Validator */ = {
isa = PBXGroup;
children = (
62D1AE1C1A1E6D4400E4DFF8 /* AppDelegate.swift */,
62D1AE1E1A1E6D4400E4DFF8 /* ViewController.swift */,
62D1AE201A1E6D4400E4DFF8 /* Main.storyboard */,
62D1AE231A1E6D4400E4DFF8 /* Images.xcassets */,
62D1AE251A1E6D4400E4DFF8 /* LaunchScreen.xib */,
62D1AE1A1A1E6D4400E4DFF8 /* Supporting Files */,
);
path = Validator;
sourceTree = "<group>";
};
62D1AE1A1A1E6D4400E4DFF8 /* Supporting Files */ = {
isa = PBXGroup;
children = (
62D1AE1B1A1E6D4400E4DFF8 /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
62D1AE2F1A1E6D4500E4DFF8 /* ValidatorTests */ = {
isa = PBXGroup;
children = (
62D1AE301A1E6D4500E4DFF8 /* Supporting Files */,
);
path = ValidatorTests;
sourceTree = "<group>";
};
62D1AE301A1E6D4500E4DFF8 /* Supporting Files */ = {
isa = PBXGroup;
children = (
62D1AE311A1E6D4500E4DFF8 /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
FB465CB41B9884F400398388 /* SwiftValidator */ = {
isa = PBXGroup;
children = (
FB465CE21B9889EA00398388 /* Rules */,
FB465CF01B9889EA00398388 /* Core */,
FB465CB71B9884F400398388 /* SwiftValidator.h */,
FB465CB51B9884F400398388 /* Supporting Files */,
);
path = SwiftValidator;
sourceTree = "<group>";
};
FB465CB51B9884F400398388 /* Supporting Files */ = {
isa = PBXGroup;
children = (
FB465CB61B9884F400398388 /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
FB465CC31B9884F400398388 /* SwiftValidatorTests */ = {
isa = PBXGroup;
children = (
FB465CC61B9884F400398388 /* SwiftValidatorTests.swift */,
FB465CC41B9884F400398388 /* Supporting Files */,
);
path = SwiftValidatorTests;
sourceTree = "<group>";
};
FB465CC41B9884F400398388 /* Supporting Files */ = {
isa = PBXGroup;
children = (
FB465CC51B9884F400398388 /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
FB465CE21B9889EA00398388 /* Rules */ = {
isa = PBXGroup;
children = (
7CC1E4CE1C636B4500AF013C /* AlphaRule.swift */,
7CC1E4D01C637A7700AF013C /* AlphaNumericRule.swift */,
7CC1E4D21C637ABC00AF013C /* CharacterSetRule.swift */,
7CC1E4D41C637C8500AF013C /* IPV4Rule.swift */,
7CC1E4D61C637F6E00AF013C /* ISBNRule.swift */,
7CC1E4DA1C63BFA600AF013C /* HexColorRule.swift */,
FB465CE31B9889EA00398388 /* ConfirmRule.swift */,
FB465CE41B9889EA00398388 /* EmailRule.swift */,
FB465CE51B9889EA00398388 /* FloatRule.swift */,
FB465CE61B9889EA00398388 /* FullNameRule.swift */,
FB465CE71B9889EA00398388 /* MaxLengthRule.swift */,
FB465CE81B9889EA00398388 /* MinLengthRule.swift */,
FB465CE91B9889EA00398388 /* PasswordRule.swift */,
FB465CEA1B9889EA00398388 /* PhoneNumberRule.swift */,
FB465CEB1B9889EA00398388 /* RegexRule.swift */,
FB465CEC1B9889EA00398388 /* RequiredRule.swift */,
FB465CED1B9889EA00398388 /* Rule.swift */,
FB465CEE1B9889EA00398388 /* ValidationRule.swift */,
FB465CEF1B9889EA00398388 /* ZipCodeRule.swift */,
62C1821C1C6312F5003788E7 /* ExactLengthRule.swift */,
);
path = Rules;
sourceTree = "<group>";
};
FB465CF01B9889EA00398388 /* Core */ = {
isa = PBXGroup;
children = (
62D9B2551C7C0B2A00BAFCE3 /* ValidationDelegate.swift */,
FB465CF11B9889EA00398388 /* ValidationError.swift */,
FB465CF21B9889EA00398388 /* Validator.swift */,
FB51E5AF1CD208B8004DE696 /* Validatable.swift */,
FBA963621CDA10130071F03E /* ValidatorDictionary.swift */,
);
path = Core;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
FB465CB01B9884F400398388 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
FB465CB81B9884F400398388 /* SwiftValidator.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
62D1AE161A1E6D4400E4DFF8 /* Validator */ = {
isa = PBXNativeTarget;
buildConfigurationList = 62D1AE361A1E6D4500E4DFF8 /* Build configuration list for PBXNativeTarget "Validator" */;
buildPhases = (
62D1AE131A1E6D4400E4DFF8 /* Sources */,
62D1AE141A1E6D4400E4DFF8 /* Frameworks */,
62D1AE151A1E6D4400E4DFF8 /* Resources */,
FB465CD11B9884F400398388 /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
FB465CC91B9884F400398388 /* PBXTargetDependency */,
);
name = Validator;
productName = Validator;
productReference = 62D1AE171A1E6D4400E4DFF8 /* Validator.app */;
productType = "com.apple.product-type.application";
};
62D1AE2B1A1E6D4500E4DFF8 /* ValidatorTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 62D1AE391A1E6D4500E4DFF8 /* Build configuration list for PBXNativeTarget "ValidatorTests" */;
buildPhases = (
62D1AE281A1E6D4500E4DFF8 /* Sources */,
62D1AE291A1E6D4500E4DFF8 /* Frameworks */,
62D1AE2A1A1E6D4500E4DFF8 /* Resources */,
);
buildRules = (
);
dependencies = (
62D1AE2E1A1E6D4500E4DFF8 /* PBXTargetDependency */,
);
name = ValidatorTests;
productName = ValidatorTests;
productReference = 62D1AE2C1A1E6D4500E4DFF8 /* ValidatorTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
FB465CB21B9884F400398388 /* SwiftValidator */ = {
isa = PBXNativeTarget;
buildConfigurationList = FB465CD01B9884F400398388 /* Build configuration list for PBXNativeTarget "SwiftValidator" */;
buildPhases = (
FB465CAE1B9884F400398388 /* Sources */,
FB465CAF1B9884F400398388 /* Frameworks */,
FB465CB01B9884F400398388 /* Headers */,
FB465CB11B9884F400398388 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = SwiftValidator;
productName = SwiftValidator;
productReference = FB465CB31B9884F400398388 /* SwiftValidator.framework */;
productType = "com.apple.product-type.framework";
};
FB465CBC1B9884F400398388 /* SwiftValidatorTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = FB465CD21B9884F400398388 /* Build configuration list for PBXNativeTarget "SwiftValidatorTests" */;
buildPhases = (
FB465CB91B9884F400398388 /* Sources */,
FB465CBA1B9884F400398388 /* Frameworks */,
FB465CBB1B9884F400398388 /* Resources */,
);
buildRules = (
);
dependencies = (
FB465CC01B9884F400398388 /* PBXTargetDependency */,
FB465CC21B9884F400398388 /* PBXTargetDependency */,
);
name = SwiftValidatorTests;
productName = SwiftValidatorTests;
productReference = FB465CBD1B9884F400398388 /* SwiftValidatorTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
62D1AE0F1A1E6D4400E4DFF8 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftMigration = 0700;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0930;
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;
};
};
};
buildConfigurationList = 62D1AE121A1E6D4400E4DFF8 /* Build configuration list for PBXProject "Validator" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 62D1AE0E1A1E6D4400E4DFF8;
productRefGroup = 62D1AE181A1E6D4400E4DFF8 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
62D1AE161A1E6D4400E4DFF8 /* Validator */,
62D1AE2B1A1E6D4500E4DFF8 /* ValidatorTests */,
FB465CB21B9884F400398388 /* SwiftValidator */,
FB465CBC1B9884F400398388 /* SwiftValidatorTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
62D1AE151A1E6D4400E4DFF8 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
62D1AE221A1E6D4400E4DFF8 /* Main.storyboard in Resources */,
62D1AE271A1E6D4400E4DFF8 /* LaunchScreen.xib in Resources */,
62D1AE241A1E6D4400E4DFF8 /* Images.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
62D1AE2A1A1E6D4500E4DFF8 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
FB465CB11B9884F400398388 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
FB465CBB1B9884F400398388 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
62D1AE131A1E6D4400E4DFF8 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FB465CE11B98854100398388 /* ViewController.swift in Sources */,
62D1AE1D1A1E6D4400E4DFF8 /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
62D1AE281A1E6D4500E4DFF8 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
FB465CAE1B9884F400398388 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
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 */,
7CC1E4D31C637ABC00AF013C /* CharacterSetRule.swift in Sources */,
FB465CFD1B9889EA00398388 /* Rule.swift in Sources */,
FB465CFA1B9889EA00398388 /* PhoneNumberRule.swift in Sources */,
FB465CF51B9889EA00398388 /* FloatRule.swift in Sources */,
7CC1E4DB1C63BFA600AF013C /* HexColorRule.swift in Sources */,
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 */,
FB465CFC1B9889EA00398388 /* RequiredRule.swift in Sources */,
FB465CFB1B9889EA00398388 /* RegexRule.swift in Sources */,
7CC1E4CF1C636B4500AF013C /* AlphaRule.swift in Sources */,
62D9B2561C7C0B2A00BAFCE3 /* ValidationDelegate.swift in Sources */,
FB465CF81B9889EA00398388 /* MinLengthRule.swift in Sources */,
FB465CF71B9889EA00398388 /* MaxLengthRule.swift in Sources */,
62C1821D1C6312F5003788E7 /* ExactLengthRule.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
FB465CB91B9884F400398388 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FB465CC71B9884F400398388 /* SwiftValidatorTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
62D1AE2E1A1E6D4500E4DFF8 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 62D1AE161A1E6D4400E4DFF8 /* Validator */;
targetProxy = 62D1AE2D1A1E6D4500E4DFF8 /* PBXContainerItemProxy */;
};
FB465CC01B9884F400398388 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = FB465CB21B9884F400398388 /* SwiftValidator */;
targetProxy = FB465CBF1B9884F400398388 /* PBXContainerItemProxy */;
};
FB465CC21B9884F400398388 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 62D1AE161A1E6D4400E4DFF8 /* Validator */;
targetProxy = FB465CC11B9884F400398388 /* PBXContainerItemProxy */;
};
FB465CC91B9884F400398388 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = FB465CB21B9884F400398388 /* SwiftValidator */;
targetProxy = FB465CC81B9884F400398388 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
62D1AE201A1E6D4400E4DFF8 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
62D1AE211A1E6D4400E4DFF8 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
62D1AE251A1E6D4400E4DFF8 /* LaunchScreen.xib */ = {
isa = PBXVariantGroup;
children = (
62D1AE261A1E6D4400E4DFF8 /* Base */,
);
name = LaunchScreen.xib;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
62D1AE341A1E6D4500E4DFF8 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
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";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
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",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
};
name = Debug;
};
62D1AE351A1E6D4500E4DFF8 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
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";
COPY_PHASE_STRIP = YES;
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;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
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;
};
62D1AE371A1E6D4500E4DFF8 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = Validator/Info.plist;
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;
};
62D1AE381A1E6D4500E4DFF8 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = Validator/Info.plist;
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;
};
62D1AE3A1A1E6D4500E4DFF8 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = ValidatorTests/Info.plist;
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;
};
62D1AE3B1A1E6D4500E4DFF8 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
INFOPLIST_FILE = ValidatorTests/Info.plist;
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;
};
FB465CCC1B9884F400398388 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "";
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = SwiftValidator/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
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 = "";
};
name = Debug;
};
FB465CCD1B9884F400398388 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = SwiftValidator/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
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 = "";
};
name = Release;
};
FB465CCE1B9884F400398388 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
);
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = SwiftValidatorTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.4;
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;
};
FB465CCF1B9884F400398388 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
);
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = SwiftValidatorTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.4;
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;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
62D1AE121A1E6D4400E4DFF8 /* Build configuration list for PBXProject "Validator" */ = {
isa = XCConfigurationList;
buildConfigurations = (
62D1AE341A1E6D4500E4DFF8 /* Debug */,
62D1AE351A1E6D4500E4DFF8 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
62D1AE361A1E6D4500E4DFF8 /* Build configuration list for PBXNativeTarget "Validator" */ = {
isa = XCConfigurationList;
buildConfigurations = (
62D1AE371A1E6D4500E4DFF8 /* Debug */,
62D1AE381A1E6D4500E4DFF8 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
62D1AE391A1E6D4500E4DFF8 /* Build configuration list for PBXNativeTarget "ValidatorTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
62D1AE3A1A1E6D4500E4DFF8 /* Debug */,
62D1AE3B1A1E6D4500E4DFF8 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
FB465CD01B9884F400398388 /* Build configuration list for PBXNativeTarget "SwiftValidator" */ = {
isa = XCConfigurationList;
buildConfigurations = (
FB465CCC1B9884F400398388 /* Debug */,
FB465CCD1B9884F400398388 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
FB465CD21B9884F400398388 /* Build configuration list for PBXNativeTarget "SwiftValidatorTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
FB465CCE1B9884F400398388 /* Debug */,
FB465CCF1B9884F400398388 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 62D1AE0F1A1E6D4400E4DFF8 /* Project object */;
}

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:Validator.xcodeproj">
</FileRef>
</Workspace>

View File

@ -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>

View File

@ -1,113 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FB465CB21B9884F400398388"
BuildableName = "SwiftValidator.framework"
BlueprintName = "SwiftValidator"
ReferencedContainer = "container:Validator.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "YES"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "62D1AE161A1E6D4400E4DFF8"
BuildableName = "Validator.app"
BlueprintName = "Validator"
ReferencedContainer = "container:Validator.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FB465CBC1B9884F400398388"
BuildableName = "SwiftValidatorTests.xctest"
BlueprintName = "SwiftValidatorTests"
ReferencedContainer = "container:Validator.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FB465CB21B9884F400398388"
BuildableName = "SwiftValidator.framework"
BlueprintName = "SwiftValidator"
ReferencedContainer = "container:Validator.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FB465CB21B9884F400398388"
BuildableName = "SwiftValidator.framework"
BlueprintName = "SwiftValidator"
ReferencedContainer = "container:Validator.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FB465CB21B9884F400398388"
BuildableName = "SwiftValidator.framework"
BlueprintName = "SwiftValidator"
ReferencedContainer = "container:Validator.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,102 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "62D1AE161A1E6D4400E4DFF8"
BuildableName = "Validator.app"
BlueprintName = "Validator"
ReferencedContainer = "container:Validator.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FB465CBC1B9884F400398388"
BuildableName = "SwiftValidatorTests.xctest"
BlueprintName = "SwiftValidatorTests"
ReferencedContainer = "container:Validator.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "62D1AE161A1E6D4400E4DFF8"
BuildableName = "Validator.app"
BlueprintName = "Validator"
ReferencedContainer = "container:Validator.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "62D1AE161A1E6D4400E4DFF8"
BuildableName = "Validator.app"
BlueprintName = "Validator"
ReferencedContainer = "container:Validator.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "62D1AE161A1E6D4400E4DFF8"
BuildableName = "Validator.app"
BlueprintName = "Validator"
ReferencedContainer = "container:Validator.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,111 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "62D1AE161A1E6D4400E4DFF8"
BuildableName = "Validator.app"
BlueprintName = "Validator"
ReferencedContainer = "container:Validator.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FB465CBC1B9884F400398388"
BuildableName = "SwiftValidatorTests.xctest"
BlueprintName = "SwiftValidatorTests"
ReferencedContainer = "container:Validator.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "62D1AE2B1A1E6D4500E4DFF8"
BuildableName = "ValidatorTests.xctest"
BlueprintName = "ValidatorTests"
ReferencedContainer = "container:Validator.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "62D1AE161A1E6D4400E4DFF8"
BuildableName = "Validator.app"
BlueprintName = "Validator"
ReferencedContainer = "container:Validator.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "62D1AE161A1E6D4400E4DFF8"
BuildableName = "Validator.app"
BlueprintName = "Validator"
ReferencedContainer = "container:Validator.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "62D1AE161A1E6D4400E4DFF8"
BuildableName = "Validator.app"
BlueprintName = "Validator"
ReferencedContainer = "container:Validator.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,46 +0,0 @@
//
// AppDelegate.swift
// Validator
//
// Created by Jeff Potter on 11/20/14.
// Copyright (c) 2014 jpotts18. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
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) {
// 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) {
// 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) {
// 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) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}

View File

@ -1,42 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2014 jpotts18. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
<rect key="frame" x="20" y="439" width="441" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Validator" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
<rect key="frame" x="20" y="140" width="441" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
</constraints>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="548" y="455"/>
</view>
</objects>
</document>

View File

@ -1,422 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
<capability name="Alignment constraints with different attributes" minToolsVersion="5.1"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="ufC-wZ-h7g">
<objects>
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModule="Validator" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/>
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Full Name" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="khR-OB-bgx">
<rect key="frame" x="0.0" y="-21" width="42" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Email" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MOa-Y4-nDo">
<rect key="frame" x="0.0" y="-21" width="42" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="darth@deathstar.com" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="ibf-gq-p2X">
<rect key="frame" x="0.0" y="-30" width="97" height="30"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Phone" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Gjm-Ww-AYk">
<rect key="frame" x="0.0" y="-21" width="42" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="XXX-XXX-XXXX" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="qLN-YJ-gUx">
<rect key="frame" x="0.0" y="-30" width="97" height="30"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Zipcode" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2or-KE-2NU">
<rect key="frame" x="0.0" y="-21" width="42" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="XXXXX" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Zu1-QS-1Yk">
<rect key="frame" x="0.0" y="-30" width="97" height="30"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Required" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5Yi-nP-Hf3">
<rect key="frame" x="0.0" y="-21" width="42" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="LPs-7H-FyD"/>
<constraint firstAttribute="width" constant="227" id="w21-aD-KtP"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
<variation key="default">
<mask key="constraints">
<exclude reference="LPs-7H-FyD"/>
<exclude reference="w21-aD-KtP"/>
</mask>
</variation>
<variation key="heightClass=regular-widthClass=compact">
<mask key="constraints">
<include reference="LPs-7H-FyD"/>
<include reference="w21-aD-KtP"/>
</mask>
</variation>
</label>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Required" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="v4N-fz-1u1">
<rect key="frame" x="0.0" y="-21" width="42" height="21"/>
<constraints>
<constraint firstAttribute="width" constant="227" id="VKF-gf-sGD"/>
<constraint firstAttribute="height" constant="21" id="bgj-nG-0Ap"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
<variation key="default">
<mask key="constraints">
<exclude reference="VKF-gf-sGD"/>
<exclude reference="bgj-nG-0Ap"/>
</mask>
</variation>
<variation key="heightClass=regular-widthClass=compact">
<mask key="constraints">
<include reference="VKF-gf-sGD"/>
<include reference="bgj-nG-0Ap"/>
</mask>
</variation>
</label>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Required" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="F6l-Qg-562">
<rect key="frame" x="0.0" y="-21" width="42" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="0h3-6j-YFh"/>
<constraint firstAttribute="width" constant="227" id="LUS-3M-2HA"/>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="21" id="Mbe-II-6LF"/>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="227" id="wg0-Uf-QiW"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
<variation key="default">
<mask key="constraints">
<exclude reference="0h3-6j-YFh"/>
<exclude reference="LUS-3M-2HA"/>
<exclude reference="Mbe-II-6LF"/>
<exclude reference="wg0-Uf-QiW"/>
</mask>
</variation>
<variation key="heightClass=regular-widthClass=compact">
<mask key="constraints">
<include reference="0h3-6j-YFh"/>
<include reference="LUS-3M-2HA"/>
<include reference="Mbe-II-6LF"/>
<include reference="wg0-Uf-QiW"/>
</mask>
</variation>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Email Confirm" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bLY-f8-5zf">
<rect key="frame" x="0.0" y="-21" width="42" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="darth@deathstar.com" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="O9u-O8-mPB">
<rect key="frame" x="0.0" y="-30" width="97" height="30"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Required" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="K92-ww-iP3">
<rect key="frame" x="0.0" y="-21" width="42" height="21"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="227" id="SdK-o6-MXe"/>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="21" id="bi4-dv-zcg"/>
<constraint firstAttribute="height" constant="21" id="fjW-er-ghM"/>
<constraint firstAttribute="width" constant="227" id="hpm-mc-xeq"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
<variation key="default">
<mask key="constraints">
<exclude reference="SdK-o6-MXe"/>
<exclude reference="bi4-dv-zcg"/>
<exclude reference="fjW-er-ghM"/>
<exclude reference="hpm-mc-xeq"/>
</mask>
</variation>
<variation key="heightClass=regular-widthClass=compact">
<mask key="constraints">
<include reference="SdK-o6-MXe"/>
<include reference="bi4-dv-zcg"/>
<include reference="fjW-er-ghM"/>
<include reference="hpm-mc-xeq"/>
</mask>
</variation>
</label>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Required" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pon-eT-yrd">
<rect key="frame" x="0.0" y="-21" width="42" height="21"/>
<constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="21" id="4F5-4M-20D"/>
<constraint firstAttribute="height" constant="21" id="70U-Mv-VvJ"/>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="227" id="MLa-nX-sH0"/>
<constraint firstAttribute="width" constant="227" id="jTg-dY-1F2"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
<variation key="default">
<mask key="constraints">
<exclude reference="4F5-4M-20D"/>
<exclude reference="70U-Mv-VvJ"/>
<exclude reference="MLa-nX-sH0"/>
<exclude reference="jTg-dY-1F2"/>
</mask>
</variation>
<variation key="heightClass=regular-widthClass=compact">
<mask key="constraints">
<include reference="4F5-4M-20D"/>
<include reference="70U-Mv-VvJ"/>
<include reference="MLa-nX-sH0"/>
<include reference="jTg-dY-1F2"/>
</mask>
</variation>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Gw5-ME-8qn">
<rect key="frame" x="-23" y="-15" width="46" height="30"/>
<state key="normal" title="Submit">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="submitTapped:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="wmP-d4-6hM"/>
</connections>
</button>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Darth Vader" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="3uK-Qz-rLB">
<rect key="frame" x="0.0" y="-30" width="97" height="30"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="ibf-gq-p2X" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leadingMargin" id="1CI-nz-vpx"/>
<constraint firstItem="Gw5-ME-8qn" firstAttribute="trailing" secondItem="kh9-bI-dsS" secondAttribute="trailingMargin" id="1Qc-NM-cha"/>
<constraint firstItem="5Yi-nP-Hf3" firstAttribute="trailing" secondItem="kh9-bI-dsS" secondAttribute="trailingMargin" id="55u-lk-Vl8"/>
<constraint firstItem="qLN-YJ-gUx" firstAttribute="trailing" secondItem="kh9-bI-dsS" secondAttribute="trailingMargin" id="60N-Dv-oSw"/>
<constraint firstItem="MOa-Y4-nDo" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leadingMargin" id="6Yc-1K-Ngl"/>
<constraint firstItem="ibf-gq-p2X" firstAttribute="trailing" secondItem="kh9-bI-dsS" secondAttribute="trailingMargin" id="6vG-Jg-fmU"/>
<constraint firstItem="F6l-Qg-562" firstAttribute="trailing" secondItem="kh9-bI-dsS" secondAttribute="trailingMargin" id="7Ce-Df-SWx"/>
<constraint firstItem="v4N-fz-1u1" firstAttribute="top" secondItem="3uK-Qz-rLB" secondAttribute="bottom" constant="21" id="7J7-45-P5G">
<variation key="heightClass=regular-widthClass=compact" constant="20"/>
</constraint>
<constraint firstItem="Gw5-ME-8qn" firstAttribute="top" secondItem="Zu1-QS-1Yk" secondAttribute="bottom" constant="30" id="7PG-72-xfy"/>
<constraint firstItem="pon-eT-yrd" firstAttribute="trailing" secondItem="kh9-bI-dsS" secondAttribute="trailingMargin" id="9zK-3U-gYU"/>
<constraint firstItem="2or-KE-2NU" firstAttribute="top" secondItem="qLN-YJ-gUx" secondAttribute="bottom" constant="32" id="A7P-r9-8FC">
<variation key="heightClass=regular-widthClass=compact" constant="20"/>
</constraint>
<constraint firstItem="Zu1-QS-1Yk" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leadingMargin" id="B28-e9-frX"/>
<constraint firstItem="O9u-O8-mPB" firstAttribute="top" secondItem="bLY-f8-5zf" secondAttribute="bottom" constant="8" id="DtP-3P-vpf"/>
<constraint firstItem="Zu1-QS-1Yk" firstAttribute="trailing" secondItem="kh9-bI-dsS" secondAttribute="trailingMargin" id="Egg-Ya-137"/>
<constraint firstItem="ibf-gq-p2X" firstAttribute="trailing" secondItem="kh9-bI-dsS" secondAttribute="trailingMargin" id="H9S-E2-xEW"/>
<constraint firstItem="3uK-Qz-rLB" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leadingMargin" id="Ion-9h-zfc"/>
<constraint firstItem="qLN-YJ-gUx" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leadingMargin" id="K5d-es-d8h"/>
<constraint firstItem="K92-ww-iP3" firstAttribute="top" secondItem="ibf-gq-p2X" secondAttribute="bottom" constant="25" id="LFO-jd-axU"/>
<constraint firstItem="Gw5-ME-8qn" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leadingMargin" id="M9f-Bp-Gbg"/>
<constraint firstItem="5Yi-nP-Hf3" firstAttribute="top" secondItem="jyV-Pf-zRb" secondAttribute="bottom" constant="8" id="OdB-kn-E8t"/>
<constraint firstItem="Gjm-Ww-AYk" firstAttribute="top" secondItem="O9u-O8-mPB" secondAttribute="bottom" constant="21" id="PEI-qV-ay9"/>
<constraint firstItem="2or-KE-2NU" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leadingMargin" id="PaQ-6i-9mo"/>
<constraint firstItem="O9u-O8-mPB" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leadingMargin" id="T1M-HW-h60"/>
<constraint firstItem="3uK-Qz-rLB" firstAttribute="top" secondItem="5Yi-nP-Hf3" secondAttribute="bottom" constant="8" id="VDP-DY-jUh"/>
<constraint firstItem="qLN-YJ-gUx" firstAttribute="top" secondItem="F6l-Qg-562" secondAttribute="bottom" constant="8" id="VDe-WO-sJU"/>
<constraint firstItem="ibf-gq-p2X" firstAttribute="top" secondItem="MOa-Y4-nDo" secondAttribute="bottom" constant="9" id="VWf-RY-YhF">
<variation key="heightClass=regular-widthClass=compact" constant="8"/>
</constraint>
<constraint firstItem="ibf-gq-p2X" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leadingMargin" id="X7j-Pp-Rbz"/>
<constraint firstItem="ibf-gq-p2X" firstAttribute="top" secondItem="v4N-fz-1u1" secondAttribute="bottom" constant="8" id="aeN-FP-LX6"/>
<constraint firstItem="khR-OB-bgx" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leadingMargin" id="bud-iX-j0f"/>
<constraint firstItem="Gjm-Ww-AYk" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leadingMargin" id="cNA-Yf-qTv"/>
<constraint firstItem="qLN-YJ-gUx" firstAttribute="top" secondItem="Gjm-Ww-AYk" secondAttribute="bottom" constant="8" id="d08-t5-VT0"/>
<constraint firstItem="O9u-O8-mPB" firstAttribute="trailing" secondItem="kh9-bI-dsS" secondAttribute="trailingMargin" id="ds9-gC-21F"/>
<constraint firstItem="Zu1-QS-1Yk" firstAttribute="top" secondItem="2or-KE-2NU" secondAttribute="bottom" constant="9" id="eAd-Wu-obj">
<variation key="heightClass=regular-widthClass=compact" constant="8"/>
</constraint>
<constraint firstItem="khR-OB-bgx" firstAttribute="top" secondItem="jyV-Pf-zRb" secondAttribute="bottom" constant="8" id="ggx-3K-K1L"/>
<constraint firstItem="MOa-Y4-nDo" firstAttribute="top" secondItem="3uK-Qz-rLB" secondAttribute="bottom" constant="21" id="h2v-wj-aTe">
<variation key="heightClass=regular-widthClass=compact" constant="20"/>
</constraint>
<constraint firstItem="v4N-fz-1u1" firstAttribute="trailing" secondItem="kh9-bI-dsS" secondAttribute="trailingMargin" id="hpD-Om-vt4"/>
<constraint firstItem="O9u-O8-mPB" firstAttribute="top" secondItem="K92-ww-iP3" secondAttribute="bottom" constant="8" id="htl-Vj-x3w"/>
<constraint firstItem="Zu1-QS-1Yk" firstAttribute="top" secondItem="pon-eT-yrd" secondAttribute="bottom" constant="9" id="k2e-YN-zp4">
<variation key="heightClass=regular-widthClass=compact" constant="8"/>
</constraint>
<constraint firstItem="bLY-f8-5zf" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leadingMargin" id="qWu-f4-OGv"/>
<constraint firstItem="3uK-Qz-rLB" firstAttribute="top" secondItem="khR-OB-bgx" secondAttribute="bottom" constant="8" id="rRl-bj-wIm"/>
<constraint firstItem="bLY-f8-5zf" firstAttribute="top" secondItem="ibf-gq-p2X" secondAttribute="bottom" constant="25" id="sh3-oU-dEE"/>
<constraint firstItem="3uK-Qz-rLB" firstAttribute="trailing" secondItem="kh9-bI-dsS" secondAttribute="trailingMargin" id="t8X-0Q-RPA"/>
<constraint firstItem="K92-ww-iP3" firstAttribute="trailing" secondItem="kh9-bI-dsS" secondAttribute="trailingMargin" id="wny-JX-bf3"/>
</constraints>
<variation key="default">
<mask key="subviews">
<exclude reference="khR-OB-bgx"/>
<exclude reference="MOa-Y4-nDo"/>
<exclude reference="ibf-gq-p2X"/>
<exclude reference="Gjm-Ww-AYk"/>
<exclude reference="qLN-YJ-gUx"/>
<exclude reference="2or-KE-2NU"/>
<exclude reference="Zu1-QS-1Yk"/>
<exclude reference="5Yi-nP-Hf3"/>
<exclude reference="v4N-fz-1u1"/>
<exclude reference="F6l-Qg-562"/>
<exclude reference="bLY-f8-5zf"/>
<exclude reference="O9u-O8-mPB"/>
<exclude reference="K92-ww-iP3"/>
<exclude reference="pon-eT-yrd"/>
<exclude reference="Gw5-ME-8qn"/>
<exclude reference="3uK-Qz-rLB"/>
</mask>
<mask key="constraints">
<exclude reference="A7P-r9-8FC"/>
<exclude reference="PaQ-6i-9mo"/>
<exclude reference="Ion-9h-zfc"/>
<exclude reference="VDP-DY-jUh"/>
<exclude reference="rRl-bj-wIm"/>
<exclude reference="t8X-0Q-RPA"/>
<exclude reference="55u-lk-Vl8"/>
<exclude reference="OdB-kn-E8t"/>
<exclude reference="7Ce-Df-SWx"/>
<exclude reference="PEI-qV-ay9"/>
<exclude reference="cNA-Yf-qTv"/>
<exclude reference="LFO-jd-axU"/>
<exclude reference="wny-JX-bf3"/>
<exclude reference="6Yc-1K-Ngl"/>
<exclude reference="h2v-wj-aTe"/>
<exclude reference="DtP-3P-vpf"/>
<exclude reference="T1M-HW-h60"/>
<exclude reference="ds9-gC-21F"/>
<exclude reference="htl-Vj-x3w"/>
<exclude reference="B28-e9-frX"/>
<exclude reference="Egg-Ya-137"/>
<exclude reference="eAd-Wu-obj"/>
<exclude reference="k2e-YN-zp4"/>
<exclude reference="qWu-f4-OGv"/>
<exclude reference="sh3-oU-dEE"/>
<exclude reference="1CI-nz-vpx"/>
<exclude reference="6vG-Jg-fmU"/>
<exclude reference="H9S-E2-xEW"/>
<exclude reference="VWf-RY-YhF"/>
<exclude reference="X7j-Pp-Rbz"/>
<exclude reference="aeN-FP-LX6"/>
<exclude reference="bud-iX-j0f"/>
<exclude reference="ggx-3K-K1L"/>
<exclude reference="9zK-3U-gYU"/>
<exclude reference="60N-Dv-oSw"/>
<exclude reference="K5d-es-d8h"/>
<exclude reference="VDe-WO-sJU"/>
<exclude reference="d08-t5-VT0"/>
<exclude reference="7J7-45-P5G"/>
<exclude reference="hpD-Om-vt4"/>
<exclude reference="1Qc-NM-cha"/>
<exclude reference="7PG-72-xfy"/>
<exclude reference="M9f-Bp-Gbg"/>
</mask>
</variation>
<variation key="heightClass=regular-widthClass=compact">
<mask key="subviews">
<include reference="khR-OB-bgx"/>
<include reference="MOa-Y4-nDo"/>
<include reference="ibf-gq-p2X"/>
<include reference="Gjm-Ww-AYk"/>
<include reference="qLN-YJ-gUx"/>
<include reference="2or-KE-2NU"/>
<include reference="Zu1-QS-1Yk"/>
<include reference="5Yi-nP-Hf3"/>
<include reference="v4N-fz-1u1"/>
<include reference="F6l-Qg-562"/>
<include reference="bLY-f8-5zf"/>
<include reference="O9u-O8-mPB"/>
<include reference="K92-ww-iP3"/>
<include reference="pon-eT-yrd"/>
<include reference="Gw5-ME-8qn"/>
<include reference="3uK-Qz-rLB"/>
</mask>
<mask key="constraints">
<include reference="A7P-r9-8FC"/>
<include reference="PaQ-6i-9mo"/>
<include reference="Ion-9h-zfc"/>
<include reference="VDP-DY-jUh"/>
<include reference="rRl-bj-wIm"/>
<include reference="t8X-0Q-RPA"/>
<include reference="55u-lk-Vl8"/>
<include reference="OdB-kn-E8t"/>
<include reference="7Ce-Df-SWx"/>
<include reference="PEI-qV-ay9"/>
<include reference="cNA-Yf-qTv"/>
<include reference="LFO-jd-axU"/>
<include reference="wny-JX-bf3"/>
<include reference="6Yc-1K-Ngl"/>
<include reference="h2v-wj-aTe"/>
<include reference="DtP-3P-vpf"/>
<include reference="T1M-HW-h60"/>
<include reference="ds9-gC-21F"/>
<include reference="htl-Vj-x3w"/>
<include reference="B28-e9-frX"/>
<include reference="Egg-Ya-137"/>
<include reference="eAd-Wu-obj"/>
<include reference="k2e-YN-zp4"/>
<include reference="qWu-f4-OGv"/>
<include reference="sh3-oU-dEE"/>
<include reference="1CI-nz-vpx"/>
<exclude reference="6vG-Jg-fmU"/>
<include reference="H9S-E2-xEW"/>
<include reference="VWf-RY-YhF"/>
<exclude reference="X7j-Pp-Rbz"/>
<include reference="aeN-FP-LX6"/>
<include reference="bud-iX-j0f"/>
<include reference="ggx-3K-K1L"/>
<include reference="9zK-3U-gYU"/>
<include reference="60N-Dv-oSw"/>
<include reference="K5d-es-d8h"/>
<include reference="VDe-WO-sJU"/>
<include reference="d08-t5-VT0"/>
<include reference="7J7-45-P5G"/>
<include reference="hpD-Om-vt4"/>
<include reference="1Qc-NM-cha"/>
<include reference="7PG-72-xfy"/>
<include reference="M9f-Bp-Gbg"/>
</mask>
</variation>
</view>
<connections>
<outlet property="emailConfirmErrorLabel" destination="K92-ww-iP3" id="EAZ-PN-mPh"/>
<outlet property="emailConfirmTextField" destination="O9u-O8-mPB" id="gsp-WL-cSi"/>
<outlet property="emailErrorLabel" destination="v4N-fz-1u1" id="aOl-vh-2bv"/>
<outlet property="emailTextField" destination="ibf-gq-p2X" id="th5-OF-xXo"/>
<outlet property="fullNameErrorLabel" destination="5Yi-nP-Hf3" id="OUq-Yl-ryr"/>
<outlet property="fullNameTextField" destination="3uK-Qz-rLB" id="Mbh-Jw-sk8"/>
<outlet property="phoneNumberErrorLabel" destination="F6l-Qg-562" id="7hN-gK-aof"/>
<outlet property="phoneNumberTextField" destination="qLN-YJ-gUx" id="FY5-Bs-rcO"/>
<outlet property="zipcodeErrorLabel" destination="pon-eT-yrd" id="nuo-Kw-cX6"/>
<outlet property="zipcodeTextField" destination="Zu1-QS-1Yk" id="bEt-HS-Je4"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="324" y="387"/>
</scene>
</scenes>
</document>

View File

@ -1,38 +0,0 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -1,40 +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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

View File

@ -1,99 +0,0 @@
//
// ViewController.swift
// Validator
//
// Created by Jeff Potter on 11/20/14.
// Copyright (c) 2014 jpotts18. All rights reserved.
//
import Foundation
import UIKit
import SwiftValidator
class ViewController: UIViewController , ValidationDelegate, UITextFieldDelegate {
// TextFields
@IBOutlet weak var fullNameTextField: UITextField!
@IBOutlet weak var emailTextField: UITextField!
@IBOutlet weak var phoneNumberTextField: UITextField!
@IBOutlet weak var zipcodeTextField: UITextField!
@IBOutlet weak var emailConfirmTextField: UITextField!
// Error Labels
@IBOutlet weak var fullNameErrorLabel: UILabel!
@IBOutlet weak var emailErrorLabel: UILabel!
@IBOutlet weak var phoneNumberErrorLabel: UILabel!
@IBOutlet weak var zipcodeErrorLabel: UILabel!
@IBOutlet weak var emailConfirmErrorLabel: UILabel!
let validator = Validator()
override func viewDidLoad() {
super.viewDidLoad()
self.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(ViewController.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
}
})
validator.registerField(fullNameTextField, errorLabel: fullNameErrorLabel , rules: [RequiredRule(), FullNameRule()])
validator.registerField(emailTextField, errorLabel: emailErrorLabel, rules: [RequiredRule(), EmailRule()])
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()])
}
@IBAction func submitTapped(_ sender: AnyObject) {
print("Validating...")
validator.validate(self)
}
// 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)
alert.addAction(defaultAction)
self.present(alert, animated: true, completion: nil)
}
func validationFailed(_ errors:[(Validatable, ValidationError)]) {
print("Validation FAILED!")
}
@objc func hideKeyboard(){
self.view.endEditing(true)
}
// MARK: Validate single field
// Don't forget to use UITextFieldDelegate
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
validator.validateField(textField){ error in
if error == nil {
// Field validation was successful
} else {
// Validation error occurred
}
}
return true
}
}

View File

@ -1,24 +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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

Some files were not shown because too many files have changed in this diff Show More