Compare commits

...

177 Commits

Author SHA1 Message Date
Alexey Gerasimov db272a717a
Merge pull request #1 from TouchInstinct/feature/newVersion
Podspec fixed
2018-12-03 12:26:46 +03:00
scoreyou 8e0168b270 Version changed 2018-12-03 12:26:05 +03:00
scoreyou f94de389e4 Podspec fixed 2018-12-03 11:51:09 +03:00
scoreyou 0190013526 Moved to swift 4.2 2018-11-30 16:46:41 +03:00
Rajat jain c0ee801a2d
Merge pull request #190 from johannespfeiffer/patch-1
Update README.md
2018-08-10 23:48:27 +05:30
Rajat jain ba27b0e501
Merge pull request #205 from syn-deepakbadiger/Swift_4.1
Enabled Swift 4.1
2018-04-23 21:07:58 +05:30
Jeff Potter fb50b97888
Update .travis.yml 2018-04-22 23:30:12 -06:00
Jeff Potter bef1c1802a
Update README.md 2018-04-22 23:20:02 -06:00
Jeff Potter 4d64561b94
Update README.md 2018-04-22 22:35:22 -06:00
Deepak Badiger b3f8d74212 Enabled Swift 4.1 2018-04-19 14:11:24 -04:00
Johannes Pfeiffer 0debc5d7eb Update README.md
Updated installation snippet to swift 4
2017-09-29 19:06:44 +02:00
David Patterson 6cff6cac3e Merge pull request #175 from andriast/master
Update RegexRule + RequiredRule
2017-07-15 19:38:18 -05:00
Jeff Potter bfa3252c45 Merge pull request #184 from wampir1408/patch-1
Update README.md
2017-07-15 15:18:40 -06:00
Asia d89d18b019 Update README.md
Fixed bug with ZipCodeRule (: for the place of =)
2017-06-02 15:35:07 +02:00
Andrey 696c600dc0 Update RegexRule + RequiredRule 2016-12-04 17:39:39 +02:00
David Patterson 2a6c23ad9e Update README.md
Updated README to highlight how to use different versions of SwiftValidator.
2016-10-06 01:02:33 -05:00
David Patterson 43fddfb385 Merge pull request #161 from jpotts18/swift-3
Swift 3
2016-10-06 00:55:20 -05:00
David Patterson 1efab45d38 Merge pull request #157 from davepatterson/swift3
Swift3
2016-10-05 01:07:36 -05:00
David Patterson 2c68d3db95 updated cocoapods to 0.32.1 on travis 2016-10-05 00:41:18 -05:00
ed-mejia 4f6e77c0aa Updated travis file 2016-08-18 11:24:56 +10:00
ed-mejia 55f282fe92 Updated travis file config 2016-08-18 10:43:40 +10:00
ed-mejia 8bf185d820 Updated travis OS and Simulator 2016-08-18 09:34:20 +10:00
ed-mejia 68fdfbdac0 Updated travis osx_image to xcode8 2016-08-18 09:16:16 +10:00
Edinson Mejia 90e141e923 Fixes to support Xcode Beta 6 2016-08-17 23:10:13 +10:00
ed-mejia 8339c8c086 Fixes to support Swift 3 Xcode Beta 4 2016-08-08 17:26:41 +10:00
David Patterson 3dc5b79272 Merge pull request #130 from sonique6784/patch-1
update code example, fix end parenthesis
2016-07-28 23:00:52 -05:00
David Patterson f8b2d242cf Merge pull request #124 from theoziran/master
fix specs to multiple validation #123
2016-06-29 23:13:42 -05:00
sonique6784 fbaf18ac67 update code example, fix end parenthesis
update code example, fix end parenthesis and validate(self) call, delegate is not need here.
2016-06-25 01:38:57 +10:00
Theoziran Lima 62586fe255 fix specs to multiple validation #123 2016-06-08 10:42:39 -03:00
David Patterson 8f224aba83 Merge pull request #122 from dadalar/master
4.0.0 podspec and readme update
2016-06-03 09:13:04 -05:00
Deniz Adalar 5abb05a423 4.0.0 podspec and readme update 2016-06-03 16:42:55 +03:00
David Patterson db6be7b53c Update README.md 2016-05-31 13:23:34 -05:00
David Patterson 6cfc49799b Update README.md
Updated ReadMe to reflect 4.0.0
2016-05-31 12:23:12 -05:00
David Patterson 2f2e183953 Update README.md
Giving credit where its due.
2016-05-28 12:42:01 -05:00
David Patterson 59d1a6398e Merge pull request #111 from dadalar/ValidatableProtocol
Remove UITextField limitations
2016-05-25 17:22:31 -05:00
Deniz Adalar f344bdc370 Merge branch 'OptionalFunctionParameters' into ValidatableProtocol
# Conflicts:
#	SwiftValidator/Core/ValidationError.swift
#	SwiftValidator/Core/Validator.swift
2016-05-25 12:32:33 +03:00
David Patterson ca7ec31141 Merge pull request #116 from racer1988/fixemailissue
fix #115: support for longer domain names from ICANN
2016-05-13 14:02:12 -05:00
David Patterson 9749d9d670 Merge pull request #114 from dadalar/OptionalFunctionParameters
Remove duplicate functions by using default values
2016-05-12 18:52:32 -05:00
Marco Pappalardo a094156445 fix #115: support for longer domain names from ICANN 2016-05-12 10:45:56 +02:00
Deniz Adalar 39530fb7d6 Remove duplicate (unnecessary) functions by using default values for optional parameters 2016-05-12 10:48:21 +03:00
David Patterson 839ef5202e Update README.md
Added alternate CocoaPod install option to ensure SwiftValidator pod mirrors master branch.
2016-05-09 14:08:52 -05:00
Deniz Adalar 2fabe418ea Refactor dictionary to return field itself instead of ObjectIdentifier 2016-05-04 16:06:13 +03:00
Deniz Adalar 8f116df330 Removed UITextField limitations and switched to Validatable protocol 2016-05-04 13:39:14 +03:00
David Patterson a2a2fb2858 Update README.md 2016-04-29 22:43:27 -05:00
David Patterson fb08dd1585 Update README.md
Added code coverage requirement.
2016-04-29 22:42:39 -05:00
David Patterson 344b178af5 Update README.md
Shamelessly giving myself credit for helping out. ;)
2016-04-18 20:46:47 -05:00
David Patterson 920f558500 Merge pull request #106 from jpotts18/updatedDocs
Updated docs
2016-04-15 18:01:31 -05:00
David Patterson 73842b0628 updated docs to reflect current codebase fixes #102 2016-04-15 17:17:59 -05:00
David Patterson ecb11dfa09 updated docs to reflect current codebase fixes #102 2016-04-15 17:16:02 -05:00
David Patterson 0f8871426a updated codebase to reflect current codebase 2016-04-15 17:09:16 -05:00
David Patterson 03a3a7ea2c Update README.md
Minor addition to documentation link.
2016-03-26 23:09:48 -05:00
David Patterson 9ce05d370f Update README.md
Format change.
2016-03-13 16:40:46 -05:00
David Patterson a63b811d62 Update README.md
Added link to documentation.
2016-03-13 16:40:02 -05:00
Jeff Potter 7b6e99590f Update README.md 2016-02-22 22:13:43 -07:00
Jeff Potter a35e66a4a9 Merge pull request #93 from jpotts18/increasing-coverage
Adding tests to check error messages. Somewhat trivial but it tests t…
2016-02-22 22:11:26 -07:00
Jeff Potter 5fc3d5d558 Adding tests to check error messages. Somewhat trivial but it tests to make sure the code coverage increase. 2016-02-22 22:01:23 -07:00
Jeff Potter 244327307d Merge branch 'bhargavg-add-new-rules'
Conflicts:
	Validator.xcodeproj/project.pbxproj
2016-02-22 21:42:35 -07:00
Jeff Potter 759d707a39 Merge pull request #91 from jpotts18/travis-codecoverage
added codecov to travis
2016-02-22 20:19:36 -07:00
David Patterson fe14244bbc added codecov to travis 2016-02-16 01:21:43 -06:00
David Patterson 52020bb7b4 Update README.md 2016-02-15 23:53:27 -06:00
David Patterson 5b83728ea1 Update README.md 2016-02-15 23:50:58 -06:00
David Patterson 264aa2866c Update README.md
Added coveralls badge
2016-02-15 23:49:38 -06:00
David Patterson a8951cd547 Merge pull request #89 from davepatterson/updated-readMe-added-Docs
updated readme and added docs
2016-02-14 16:12:16 -06:00
David Patterson 301d3f24f9 updated readme and added docs 2016-02-14 15:28:31 -06:00
Bhargav dd07b9a940 Add new rules as per #83 and their test cases
Added the following new rules along with test cases
- AlphaRule
- AlphaNumericRule
- IPv4
- ISBN
- Hexcolor
2016-02-04 23:37:09 +05:30
Jeff Potter ef44bf5477 ExactLengthRule, PhoneNumber public, Tests added 2016-02-03 23:09:39 -07:00
Jeff Potter 3621ec85ff Merge pull request #72 from jersonperpetua/minimum_deployment_target_iOS_8.0
Reduce the minimum deployment target to iOS 8.0
2016-02-03 21:57:53 -07:00
Jeff Potter 86e735397d Merge pull request #75 from ivopisarovic/master
The whole string needs to match number format.
2016-02-03 21:57:19 -07:00
Jeff Potter d080a6c3cb Merge pull request #63 from mathielo/single_field_validation
Single field validation
2016-02-03 21:34:36 -07:00
Ivo Pisařovic 7caf01d671 The whole string needs to match number format.
The original version also allowed values like "a21", "4b" or "7.2.5".
2016-01-22 12:17:45 +01:00
Jerson Michael Perpetua 8979561f70 Reduce the minimum deployment target to iOS 8.0 2016-01-12 09:59:36 +08:00
Caio Mathielo fdf332d024 Adding single field validation Tests 2016-01-06 12:43:29 -02:00
Caio Mathielo 3e1c46a889 Merge branch 'master' into single_field_validation 2016-01-06 12:16:42 -02:00
Jeff Potter 5f0f429df8 Merge pull request #66 from michalkalinowski-/carthage_fix
Carthage fix
2015-11-22 15:03:26 -07:00
mkalinowski 4ae2d89d08 Fixes scheme 2015-11-18 15:42:06 +01:00
mkalinowski a189b5a00b Fixes quotes
Previous ones were not recognized as valid characters by Carthage
2015-11-18 15:40:39 +01:00
Caio Mathielo 73e1e443a5 Updating README, adding Single Field Validation 2015-10-28 18:30:00 -02:00
Caio Mathielo dd7007d6ad Adding public method validateField() 2015-10-28 18:22:24 -02:00
Jeff Potter 3645d74294 Update README.md 2015-10-15 15:10:18 -06:00
Jeff Potter 293d450235 Merge pull request #62 from jpotts18/3.0.0-podspec
updating travis to check podspec, bumping version to 3.0.1
2015-10-15 15:00:13 -06:00
Jeff Potter 2de680518a Update README.md 2015-10-15 14:59:46 -06:00
Jeff Potter e1be08bec5 updating travis to check podspec, bumping version to 3.0.1 2015-10-15 14:43:00 -06:00
Jeff Potter f9bd317c34 Merge pull request #61 from jpotts18/travis-ci
adding travis file
2015-10-15 14:12:20 -06:00
Jeff Potter 2003f8f30f Disable Validator Test from Scheme 2015-10-15 14:04:56 -06:00
Jeff Potter 394653e6e9 Adding Schemes 2015-10-15 13:59:47 -06:00
Jeff Potter efcbdf53a1 trying to use other defaults 2015-10-15 13:53:46 -06:00
Jeff Potter 7ee6f1f255 trying to use other defaults 2015-10-15 13:51:03 -06:00
Jeff Potter 6393f00518 adding travis file 2015-10-15 13:47:44 -06:00
Jeff Potter 3e881899d4 Small chnages to Scheme and moving tests 2015-10-15 13:36:41 -06:00
Jeff Potter 5e32b891c4 Adding Carthage support 2015-10-15 12:06:44 -06:00
Jeff Potter 3614caf857 Merge pull request #58 from c0rn0/fix/excludeAppDelegateFromPod1
Added the AppDelegate as an exclude-pod-file
2015-09-22 09:48:57 -06:00
c0rn0 4c00feeefb Added the AppDelegate as a file that must be excluded from the pod install. 2015-09-22 07:23:26 +02:00
Jeff Potter 0e53e79989 Update README.md 2015-09-20 23:29:24 -06:00
Jeff Potter d801538d33 Merge pull request #52 from goodeggs/swift-2.0
Migrate to Swift 2.0
2015-09-10 20:12:43 -06:00
Jonah Williams 45da08a089 Convert `var` to `let`, resolve warning. 2015-09-10 17:36:23 -07:00
Jonah Williams 2b342f8884 Add missing phone number rule to project 2015-09-10 17:36:00 -07:00
Jonah Williams b4d1a0c24e Bump podspec version to `3.0.0`
A new major release since Swift 2.0 changes are not backwards compatible for anyone using Xcode 6/Swift 1.2.
2015-09-10 17:29:49 -07:00
Jonah Williams 52a2138dd6 Remove unused framework search path, fix warning 2015-09-10 17:23:12 -07:00
Jonah Williams 7c31d5fd9e Add constructor calls to fix test build errors 2015-09-10 17:22:49 -07:00
Jonah Williams 1b7c541ed3 Perform recommended update to .pbxproj
XCode suggests `ENABLE_TESTABILITY`, and updates to `PRODUCT_BUNDLE_IDENTIFIER`
2015-09-10 17:19:27 -07:00
Jonah Williams b89c188ecc `UITextField.text` is now an optional
With the Xcode 7 GM release `text` is now an optional despite the documentation stating a default value of "" so we need to unwrap it or provide a default to satisfy the compiler.
2015-09-10 17:16:47 -07:00
Jonah Williams 9b34d138b7 `ValidationError` inherits from `NSObject`
`ValidationError` is now an `NSObject` subclass so that `ValidationDelegate` can declare an argument of type `UITextField:ValidationError`. When `ValidationError` is a Swift only class we get a compile error (in Xcode Version 7.0 GM (7A218)):

> Validator.swift:14:10: Method cannot be a member of an @objc protocol because the type of the parameter cannot be represented in Objective-C

Conflicts:
	Validator/ValidationError.swift
2015-09-10 17:11:59 -07:00
Jonah Williams 5ed3d8c6ba Automatic migration to Swift 2.0
Converted using Xcode 7.0 GM release (Version 7A218).
2015-09-10 17:09:31 -07:00
Jeff Potter ca6509687e Merge pull request #40 from KVTaniguchi/refactorValidationRule
apply rules with map and filter
2015-07-20 21:12:53 -07:00
Jeff Potter dc9224c30f Merge pull request #39 from KVTaniguchi/RefactorValidator
refactor Validator
2015-07-20 21:11:28 -07:00
Jeff Potter f5376fbeee Merge pull request #33 from mla2c/master
All rules: init with optional user-defined message
2015-07-20 21:10:16 -07:00
Kevin Taniguchi b95902919b apply rules with map and filter 2015-06-28 15:55:19 -04:00
Kevin Taniguchi 21a5cc52e2 refactor Validator
using type inferencing
loop keys, values in validations
2015-06-28 14:56:40 -04:00
mla2c 4d3f245f7a Correct conflict 2015-06-12 08:43:19 +02:00
mla2c d3b92f5a5f Merge remote-tracking branch 'upstream/master' 2015-06-12 08:36:10 +02:00
Jeff Potter 724a05cf72 Merge pull request #32 from leodasvacas/regex-messages
Custom messages for regex rules
2015-06-11 11:00:21 -06:00
mla2c 0edfb58cc4 All rules: init with optional user-defined message possible 2015-06-01 14:54:50 +02:00
mla2c ba9615cc85 Changes from leodasvacas fork (Custom messages for regex rules, commit 157e9791fb) 2015-06-01 14:13:26 +02:00
Leonardo Yvens ab2bb9802b Update README.md
Added custom message example. Sanitized SSN example.
2015-05-30 20:03:09 -03:00
leonardo.yvens 157e9791fb Custom messages for regex rules 2015-05-24 13:12:23 -03:00
Jeff Potter 5a3ddcb795 updating readme, fixing extraneous # in parameter 2015-05-06 13:41:04 -06:00
Jeff Potter d51e904935 Merge pull request #28 from cameronmccord2/master
FloatRule, style transform callback on success/error
2015-05-06 13:27:32 -06:00
Cameron McCord a685e16bc4 cleaned up code, fixed tests 2015-05-06 11:44:25 -06:00
Cameron McCord cc0089d901 Changed to passing in transform functions for your text fields 2015-05-06 11:31:49 -06:00
Cameron McCord afc15b0aa4 colors on text fields get cleared afterwards 2015-05-05 19:21:31 -06:00
Cameron McCord 847885a490 added float rule with tests 2015-05-05 18:58:11 -06:00
Cameron McCord ab0f1f189d added test to check that color doesn't change automatically 2015-05-05 18:42:08 -06:00
Cameron McCord 6c93e83a2d Added test for testing uitextfield border color 2015-05-05 18:38:45 -06:00
Cameron McCord c6f82a0bea removed let color 2015-05-05 18:36:12 -06:00
Cameron McCord ae64d62951 removed color feature 2015-05-05 18:35:23 -06:00
Cameron McCord 4c7462e6a5 Added tests for coloring text fields 2015-05-05 18:32:20 -06:00
Cameron McCord 19490824c3 Error fields auto-set error messages if given, can specify a different text field border color, can have the validator add the colored border to errored text fields 2015-05-05 18:21:35 -06:00
Jeff Potter cc5e16aedd Merge pull request #27 from snorpey/deregister-error-fix
Fix issue with errors showing up for unregistered fields
2015-05-05 13:03:13 -06:00
Georg Fischer ffe902dba9 fix issue with errors showing up for unregistered fields 2015-05-05 16:52:08 +02:00
Jeff Potter 34eced2b1e Merge pull request #26 from cameronmccord2/master
Added validate function with callback + tests
2015-04-30 17:59:46 -06:00
Cameron McCord dfa5c257ce Added validate function with callback + tests 2015-04-30 17:55:06 -06:00
Jeff Potter 8d25feda3f Update README.md 2015-04-30 17:46:28 -06:00
Jeff Potter 17c0923537 Merge pull request #17 from zarv1k/swift1.2
fixes for compatibility with swift 1.2
2015-04-30 17:43:59 -06:00
Jeff Potter 62c0706d28 Merge pull request #20 from snorpey/deregister-textfield
add deregisterField method
2015-04-15 13:37:58 -06:00
Georg Fischer 5fcd1d12e0 add unregisterTextField example to readme 2015-04-15 21:24:46 +02:00
Georg Fischer 18af245f78 add tests for registerField and unregisterField 2015-04-15 21:23:52 +02:00
Georg Fischer 3a68b97a86 rename method to unregisterField 2015-04-15 21:23:10 +02:00
Georg Fischer edb5f61dda add deregisterField method 2015-04-15 17:23:28 +02:00
Jeff Potter f155284c97 Merge pull request #19 from snorpey/readme-fix
Update readme to reflect updated ValidationDelegate method name
2015-04-15 08:40:46 -06:00
Georg Fischer 323103e514 Update readme to reflect updated delegate method name 2015-04-15 14:28:43 +02:00
Dmitry Zarva 0497bbbbe0 fixes for compatibility with swift 1.2 2015-04-11 23:26:23 +03:00
Jeff Potter 0c50381640 adding updates to readme and podspec 2015-04-10 15:37:58 -06:00
Jeff Potter 1d93171cb4 updating podspec 2015-04-10 15:06:17 -06:00
Jeff Potter 4dee25a5f5 fixing some formating problems on test 2015-04-10 13:52:17 -06:00
Jeff Potter 0bc6e7a50a adding tests, refactoring to make easier to understand 2015-04-10 13:50:28 -06:00
Jeff Potter 8a6c7f99cd Merge branch 'gberger-master' 2015-04-10 10:57:19 -06:00
Jeff Potter e09ee70c96 Adding max length rule and fixing method access to make it public 2015-04-10 10:55:04 -06:00
Jeff Potter 64eed84b72 Merge branch 'master' of https://github.com/gberger/swift-validator into gberger-master 2015-04-10 10:48:59 -06:00
Jeff Potter 970333e0c0 simplifying method names, adding public access to classes 2015-04-10 10:48:14 -06:00
Guilherme Berger 20f1238e66 Create MaxLengthRule.swift 2015-04-06 04:24:39 -04:00
Jeff Potter f016c1ac65 Update Readme to move Cocoapods to somewhere else 2015-04-04 00:16:05 -06:00
Jeff Potter f51744a90f Merge branch 'bqmackay-Copyright'
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2015-04-04 00:10:58 -06:00
Jeff Potter 1303eedce2 refactoring and adding regexrule as super class 2015-04-04 00:08:31 -06:00
Jeff Potter 9c4ee432c2 refactoring and adding regexrule as super class 2015-04-04 00:08:07 -06:00
Jeff Potter 26db247294 renaming podspec 2015-04-03 23:25:19 -06:00
Jeff Potter fe8f0cc360 Adding MIT license to Podspec 2015-04-03 22:23:39 -06:00
Jeff Potter 9108d01ddb adding license and reworking podspec 2015-04-03 22:20:54 -06:00
Jeff Potter c5a6bcbe3a Merge pull request #11 from asotog/master
Pods support fixes
2015-04-03 21:56:57 -06:00
Byron Mackay a0fa3baf5a Copyright fixes 2015-04-03 14:27:35 -06:00
Byron Mackay 274556a578 Minor style changes 2015-04-03 14:26:51 -06:00
alejandro soto 2c4ffda517 Merge remote-tracking branch 'upstream/master'
Conflicts:
	Swift_Validator.podspec
	Validator/EmailRule.swift
	Validator/PasswordRule.swift
	Validator/ZipCodeRule.swift
2015-03-30 21:27:15 -06:00
alejandro soto b216f7b411 podspec updated and more updates 2015-03-30 20:54:26 -06:00
alejandro soto e10bdb3064 podspec updated 2015-03-30 20:14:01 -06:00
alejandro soto 8dafa0f02f more public access modifiers 2015-03-30 20:13:06 -06:00
alejandro soto 56bd39702c public modifiers for classes, initializers, methods.. 2015-03-30 20:02:46 -06:00
alejandro soto 3600cf0d38 pod updates 2015-03-30 17:20:41 -06:00
alejandro soto f7d47ef2de file name updated 2015-03-30 16:49:44 -06:00
alejandro soto 62a3087d90 spec updated 2015-03-30 16:31:04 -06:00
Jeff Potter b949078cef adding new podspec 2015-03-30 16:17:13 -06:00
Jeff Potter 36b4402768 rolling back count to countElements 2015-03-30 16:10:35 -06:00
Jeff Potter 00e8db0ce2 refactoring validate methods for regex rules 2015-03-30 15:59:40 -06:00
Jeff Potter aad6604eac fixed untracked files 2015-03-30 15:46:41 -06:00
Jeff Potter 5c227400f0 Merge pull request #10 from asotog/master
Cocoapods and swift 1.1 support
2015-03-30 15:16:07 -06:00
alejandro soto 28180d899c support swift 1.1 2015-03-30 14:23:24 -06:00
alejandro soto 50e237d7f3 target removed 2015-03-27 20:37:51 -06:00
alejandro soto 22eaf6f482 pod renamed 2015-03-27 13:55:10 -06:00
Jeff Potter 07cc072e20 Update MinLengthRule.swift 2015-03-25 09:13:04 -06:00
134 changed files with 18751 additions and 726 deletions

34
.gitignore vendored Normal file
View File

@ -0,0 +1,34 @@
.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

24
.travis.yml Normal file
View File

@ -0,0 +1,24 @@
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

21
LICENSE.txt Normal file
View File

@ -0,0 +1,21 @@
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.

142
README.md
View File

@ -1,27 +1,67 @@
Swift-Validator
SwiftValidator
===============
Swift Validator is a rule-based validation library for Swift.
[![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``
* ``UITextField`` + ``ValidationError`` come out of ``Validator``
* ``Validator`` evaluates ``[Rule]`` sequentially and stops evaluating when a ``Rule`` fails.
## Quick Start
## 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
@ -34,15 +74,18 @@ override func viewDidLoad() {
validator.registerField(fullNameTextField, rules: [RequiredRule(), FullNameRule()])
// You can pass in error labels with your rules
validator.registerField(emailTextField, errorLabel: emailErrorLabel, rules: [RequiredRule(), EmailRule()])
// 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}")])
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)
}
```
@ -51,74 +94,85 @@ Validate Fields on button tap or however you would like to trigger it.
```swift
@IBAction func signupTapped(sender: AnyObject) {
validator.validateAll(delegate:self)
validator.validate(self)
}
```
Implement the Validation Delegate in your View controller
```swift
// ValidationDelegate methods
func validationWasSuccessful() {
func validationSuccessful() {
// submit the form
}
func validationFailed(errors:[UITextField:ValidationError]) {
// turn the fields to red
for (field, error) in validator.errors {
field.layer.borderColor = UIColor.redColor().CGColor
field.layer.borderWidth = 1.0
error.errorLabel?.text = error.errorMessage // works if you added labels
error.errorLabel?.hidden = false
}
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 implements the Rule protocol
Create a class that inherits from RegexRule
```swift
class SSNVRule: Rule {
let REGEX = "^\\d{3}-\\d{2}-\\d{4}$"
init(){}
// allow for custom variables to be passed
init(regex:String){
self.REGEX = regex
}
func validate(value: String) -> Bool {
if let ssnTest = NSPredicate(format: "SELF MATCHES %@", REGEX) {
if ssnTest.evaluateWithObject(value) {
return true
}
return false
}
}
func errorMessage() -> String{
return "Not a valid SSN"
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).
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/swift-validator/fork)
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%

17
SwiftValidator.podspec Normal file
View File

@ -0,0 +1,17 @@
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

@ -0,0 +1,25 @@
//
// 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

@ -0,0 +1,27 @@
//
// 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

@ -0,0 +1,33 @@
//
// 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

@ -0,0 +1,154 @@
//
// 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

@ -0,0 +1,45 @@
//
// 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()
}
}

26
SwiftValidator/Info.plist Normal file
View File

@ -0,0 +1,26 @@
<?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

@ -0,0 +1,26 @@
//
// 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

@ -0,0 +1,26 @@
//
// 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

@ -0,0 +1,55 @@
//
// 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

@ -0,0 +1,52 @@
//
// 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

@ -0,0 +1,27 @@
//
// 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

@ -0,0 +1,50 @@
//
// 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

@ -0,0 +1,51 @@
//
// 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

@ -0,0 +1,46 @@
//
// 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

@ -0,0 +1,27 @@
//
// 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

@ -0,0 +1,27 @@
//
// 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

@ -0,0 +1,191 @@
//
// 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

@ -0,0 +1,51 @@
//
// 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

@ -0,0 +1,52 @@
//
// 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

@ -0,0 +1,35 @@
//
// 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

@ -0,0 +1,29 @@
//
// 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

@ -0,0 +1,51 @@
//
// 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

@ -0,0 +1,46 @@
//
// 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

@ -0,0 +1,27 @@
//
// 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

@ -0,0 +1,45 @@
//
// 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

@ -0,0 +1,24 @@
//
// 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

@ -0,0 +1,19 @@
//
// 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

@ -0,0 +1,24 @@
<?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

@ -0,0 +1,433 @@
//
// 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,14 +0,0 @@
Pod::Spec.new do |s|
s.name = "Swift-Validator"
s.version = "2.0.1"
s.summary = "A UITextField Validation library for Swift"
s.homepage = "https://github.com/jpotts18/swift-validator"
s.screenshots = "https://raw.githubusercontent.com/jpotts18/swift-validator/master/swift-validator-v2.gif"
s.license = { :type => "Apache 2.0", :file => "LICENCE.txt" }
s.author = { "Jeff" => "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/jpotts18/swift-validator.git", :tag => "2.0.1" }
s.source_files = "Validator/*.swift"
end

View File

@ -7,23 +7,41 @@
objects = {
/* Begin PBXBuildFile section */
628637261AAA474B00BC8FCF /* MinLengthRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 628637251AAA474B00BC8FCF /* MinLengthRule.swift */; };
628637281AAA49E300BC8FCF /* ConfirmRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 628637271AAA49E300BC8FCF /* ConfirmRule.swift */; };
62C1821D1C6312F5003788E7 /* ExactLengthRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62C1821C1C6312F5003788E7 /* ExactLengthRule.swift */; };
62D1AE1D1A1E6D4400E4DFF8 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62D1AE1C1A1E6D4400E4DFF8 /* AppDelegate.swift */; };
62D1AE1F1A1E6D4400E4DFF8 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62D1AE1E1A1E6D4400E4DFF8 /* ViewController.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 */; };
62D1AE331A1E6D4500E4DFF8 /* ValidatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62D1AE321A1E6D4500E4DFF8 /* ValidatorTests.swift */; };
62D1AE4F1A1E6FF800E4DFF8 /* ValidationError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62D1AE451A1E6FF800E4DFF8 /* ValidationError.swift */; };
62D1AE521A1E6FF800E4DFF8 /* ValidationRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62D1AE481A1E6FF800E4DFF8 /* ValidationRule.swift */; };
62D1AE581A1E700200E4DFF8 /* Validator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62D1AE541A1E700200E4DFF8 /* Validator.swift */; };
62DC8D651AAA42520095DFA7 /* Rule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62DC8D641AAA42520095DFA7 /* Rule.swift */; };
62DC8D681AAA42920095DFA7 /* FullNameRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62DC8D671AAA42920095DFA7 /* FullNameRule.swift */; };
62DC8D6C1AAA42CE0095DFA7 /* EmailRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62DC8D691AAA42CE0095DFA7 /* EmailRule.swift */; };
62DC8D6D1AAA42CE0095DFA7 /* RequiredRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62DC8D6A1AAA42CE0095DFA7 /* RequiredRule.swift */; };
62DC8D6E1AAA42CE0095DFA7 /* PasswordRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62DC8D6B1AAA42CE0095DFA7 /* PasswordRule.swift */; };
62DC8D711AAA43110095DFA7 /* ZipCodeRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62DC8D701AAA43110095DFA7 /* ZipCodeRule.swift */; };
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 */
@ -34,11 +52,45 @@
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 */
628637251AAA474B00BC8FCF /* MinLengthRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MinLengthRule.swift; sourceTree = "<group>"; };
628637271AAA49E300BC8FCF /* ConfirmRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConfirmRule.swift; sourceTree = "<group>"; };
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>"; };
@ -48,16 +100,36 @@
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>"; };
62D1AE321A1E6D4500E4DFF8 /* ValidatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ValidatorTests.swift; sourceTree = "<group>"; };
62D1AE451A1E6FF800E4DFF8 /* ValidationError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValidationError.swift; sourceTree = "<group>"; };
62D1AE481A1E6FF800E4DFF8 /* ValidationRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValidationRule.swift; sourceTree = "<group>"; };
62D1AE541A1E700200E4DFF8 /* Validator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Validator.swift; sourceTree = "<group>"; };
62DC8D641AAA42520095DFA7 /* Rule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Rule.swift; sourceTree = "<group>"; };
62DC8D671AAA42920095DFA7 /* FullNameRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FullNameRule.swift; sourceTree = "<group>"; };
62DC8D691AAA42CE0095DFA7 /* EmailRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EmailRule.swift; sourceTree = "<group>"; };
62DC8D6A1AAA42CE0095DFA7 /* RequiredRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RequiredRule.swift; sourceTree = "<group>"; };
62DC8D6B1AAA42CE0095DFA7 /* PasswordRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PasswordRule.swift; sourceTree = "<group>"; };
62DC8D701AAA43110095DFA7 /* ZipCodeRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ZipCodeRule.swift; 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 */
@ -65,6 +137,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FB465CCA1B9884F400398388 /* SwiftValidator.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -75,23 +148,31 @@
);
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 */
626BE5EE1A9B8EC600FE6D5C /* Classes */ = {
isa = PBXGroup;
children = (
62DC8D661AAA42700095DFA7 /* Rules */,
62D1AE3C1A1E6FAF00E4DFF8 /* Core */,
);
name = Classes;
sourceTree = "<group>";
};
62D1AE0E1A1E6D4400E4DFF8 = {
isa = PBXGroup;
children = (
62D1AE191A1E6D4400E4DFF8 /* Validator */,
62D1AE2F1A1E6D4500E4DFF8 /* ValidatorTests */,
FB465CB41B9884F400398388 /* SwiftValidator */,
FB465CC31B9884F400398388 /* SwiftValidatorTests */,
62D1AE181A1E6D4400E4DFF8 /* Products */,
);
sourceTree = "<group>";
@ -101,6 +182,8 @@
children = (
62D1AE171A1E6D4400E4DFF8 /* Validator.app */,
62D1AE2C1A1E6D4500E4DFF8 /* ValidatorTests.xctest */,
FB465CB31B9884F400398388 /* SwiftValidator.framework */,
FB465CBD1B9884F400398388 /* SwiftValidatorTests.xctest */,
);
name = Products;
sourceTree = "<group>";
@ -108,7 +191,6 @@
62D1AE191A1E6D4400E4DFF8 /* Validator */ = {
isa = PBXGroup;
children = (
626BE5EE1A9B8EC600FE6D5C /* Classes */,
62D1AE1C1A1E6D4400E4DFF8 /* AppDelegate.swift */,
62D1AE1E1A1E6D4400E4DFF8 /* ViewController.swift */,
62D1AE201A1E6D4400E4DFF8 /* Main.storyboard */,
@ -130,7 +212,6 @@
62D1AE2F1A1E6D4500E4DFF8 /* ValidatorTests */ = {
isa = PBXGroup;
children = (
62D1AE321A1E6D4500E4DFF8 /* ValidatorTests.swift */,
62D1AE301A1E6D4500E4DFF8 /* Supporting Files */,
);
path = ValidatorTests;
@ -144,33 +225,94 @@
name = "Supporting Files";
sourceTree = "<group>";
};
62D1AE3C1A1E6FAF00E4DFF8 /* Core */ = {
FB465CB41B9884F400398388 /* SwiftValidator */ = {
isa = PBXGroup;
children = (
62D1AE541A1E700200E4DFF8 /* Validator.swift */,
62D1AE451A1E6FF800E4DFF8 /* ValidationError.swift */,
62D1AE481A1E6FF800E4DFF8 /* ValidationRule.swift */,
FB465CE21B9889EA00398388 /* Rules */,
FB465CF01B9889EA00398388 /* Core */,
FB465CB71B9884F400398388 /* SwiftValidator.h */,
FB465CB51B9884F400398388 /* Supporting Files */,
);
name = Core;
path = SwiftValidator;
sourceTree = "<group>";
};
62DC8D661AAA42700095DFA7 /* Rules */ = {
FB465CB51B9884F400398388 /* Supporting Files */ = {
isa = PBXGroup;
children = (
628637251AAA474B00BC8FCF /* MinLengthRule.swift */,
62DC8D641AAA42520095DFA7 /* Rule.swift */,
62DC8D691AAA42CE0095DFA7 /* EmailRule.swift */,
62DC8D6A1AAA42CE0095DFA7 /* RequiredRule.swift */,
62DC8D6B1AAA42CE0095DFA7 /* PasswordRule.swift */,
62DC8D671AAA42920095DFA7 /* FullNameRule.swift */,
62DC8D701AAA43110095DFA7 /* ZipCodeRule.swift */,
628637271AAA49E300BC8FCF /* ConfirmRule.swift */,
FB465CB61B9884F400398388 /* Info.plist */,
);
name = Rules;
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;
@ -179,10 +321,12 @@
62D1AE131A1E6D4400E4DFF8 /* Sources */,
62D1AE141A1E6D4400E4DFF8 /* Frameworks */,
62D1AE151A1E6D4400E4DFF8 /* Resources */,
FB465CD11B9884F400398388 /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
FB465CC91B9884F400398388 /* PBXTargetDependency */,
);
name = Validator;
productName = Validator;
@ -207,20 +351,70 @@
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 = {
LastUpgradeCheck = 0610;
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;
};
};
@ -240,6 +434,8 @@
targets = (
62D1AE161A1E6D4400E4DFF8 /* Validator */,
62D1AE2B1A1E6D4500E4DFF8 /* ValidatorTests */,
FB465CB21B9884F400398388 /* SwiftValidator */,
FB465CBC1B9884F400398388 /* SwiftValidatorTests */,
);
};
/* End PBXProject section */
@ -262,6 +458,20 @@
);
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 */
@ -269,19 +479,8 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
62DC8D681AAA42920095DFA7 /* FullNameRule.swift in Sources */,
62D1AE4F1A1E6FF800E4DFF8 /* ValidationError.swift in Sources */,
62DC8D6E1AAA42CE0095DFA7 /* PasswordRule.swift in Sources */,
62DC8D6C1AAA42CE0095DFA7 /* EmailRule.swift in Sources */,
628637281AAA49E300BC8FCF /* ConfirmRule.swift in Sources */,
62DC8D651AAA42520095DFA7 /* Rule.swift in Sources */,
62D1AE1F1A1E6D4400E4DFF8 /* ViewController.swift in Sources */,
62DC8D6D1AAA42CE0095DFA7 /* RequiredRule.swift in Sources */,
FB465CE11B98854100398388 /* ViewController.swift in Sources */,
62D1AE1D1A1E6D4400E4DFF8 /* AppDelegate.swift in Sources */,
62D1AE581A1E700200E4DFF8 /* Validator.swift in Sources */,
628637261AAA474B00BC8FCF /* MinLengthRule.swift in Sources */,
62DC8D711AAA43110095DFA7 /* ZipCodeRule.swift in Sources */,
62D1AE521A1E6FF800E4DFF8 /* ValidationRule.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -289,7 +488,46 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
62D1AE331A1E6D4500E4DFF8 /* ValidatorTests.swift in Sources */,
);
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;
};
@ -301,6 +539,21 @@
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 */
@ -331,20 +584,32 @@
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",
@ -357,11 +622,12 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.1;
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;
};
@ -373,13 +639,23 @@
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";
@ -387,15 +663,18 @@
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.1;
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;
@ -406,7 +685,9 @@
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;
};
@ -416,7 +697,10 @@
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;
};
@ -424,17 +708,15 @@
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
);
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;
@ -443,13 +725,109 @@
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)",
);
INFOPLIST_FILE = ValidatorTests/Info.plist;
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;
@ -484,6 +862,24 @@
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

@ -0,0 +1,8 @@
<?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,41 +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>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>41CB4003-1551-4C4C-B53F-78A56D1DFBE5</string>
<key>IDESourceControlProjectName</key>
<string>Validator</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>42B8B6166721AE55A9AFCAC5F4DF5276CF0E0973</key>
<string>github.com:jpotts18/swift-validator.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>Validator.xcodeproj</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>42B8B6166721AE55A9AFCAC5F4DF5276CF0E0973</key>
<string>../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>github.com:jpotts18/swift-validator.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>111</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>42B8B6166721AE55A9AFCAC5F4DF5276CF0E0973</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>42B8B6166721AE55A9AFCAC5F4DF5276CF0E0973</string>
<key>IDESourceControlWCCName</key>
<string>Validator</string>
</dict>
</array>
</dict>
</plist>

View File

@ -0,0 +1,113 @@
<?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

@ -0,0 +1,102 @@
<?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,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0610"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -20,30 +20,26 @@
ReferencedContainer = "container:Validator.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "62D1AE2B1A1E6D4500E4DFF8"
BuildableName = "ValidatorTests.xctest"
BlueprintName = "ValidatorTests"
ReferencedContainer = "container:Validator.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
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"
@ -62,17 +58,21 @@
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"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "62D1AE161A1E6D4400E4DFF8"
@ -85,12 +85,13 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "62D1AE161A1E6D4400E4DFF8"

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
</Bucket>

View File

@ -1,27 +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>SchemeUserState</key>
<dict>
<key>Validator.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>62D1AE161A1E6D4400E4DFF8</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>62D1AE2B1A1E6D4500E4DFF8</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

View File

@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(application: UIApplication) {
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
func applicationDidEnterBackground(application: UIApplication) {
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(application: UIApplication) {
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(application: UIApplication) {
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(application: UIApplication) {
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

View File

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6214" systemVersion="14A314h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
<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>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6207"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
</dependencies>
<objects>
@ -14,13 +15,13 @@
<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" cocoaTouchSystemColor="darkTextColor"/>
<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" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>

View File

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7528.3" systemVersion="14C109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
<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>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7518.3"/>
<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>

View File

@ -1,32 +0,0 @@
//
// ConfirmRule.swift
// Validator
//
// Created by Jeff Potter on 3/6/15.
// Copyright (c) 2015 jpotts18. All rights reserved.
//
import Foundation
import UIKit
class ConfirmationRule: Rule {
let confirmField: UITextField
init(confirmField: UITextField) {
self.confirmField = confirmField
}
func validate(value: String) -> Bool {
if self.confirmField.text == value {
return true
} else {
return false
}
}
func errorMessage() -> String {
return "This field does not match"
}
}

View File

@ -1,34 +0,0 @@
//
// EmailValidation.swift
// Pingo
//
// Created by Jeff Potter on 11/11/14.
// Copyright (c) 2014 Byron Mackay. All rights reserved.
//
import Foundation
class EmailRule: Rule {
var REGEX : String
init(){
self.REGEX = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}"
}
init(regex:String){
REGEX = regex
}
func validate(value: String) -> Bool {
let test = NSPredicate(format: "SELF MATCHES %@", self.REGEX)
if test.evaluateWithObject(value) {
return true
}
return false
}
func errorMessage() -> String {
return "Must be a valid email address"
}
}

View File

@ -1,30 +0,0 @@
//
// FullNameValidation.swift
// Pingo
//
// Created by Jeff Potter on 11/19/14.
// Copyright (c) 2014 Byron Mackay. All rights reserved.
//
import Foundation
class FullNameRule : Rule {
var message:String {
return "Please provide a first & last name"
}
func validate(value:String) -> Bool {
var nameArray:[String] = split(value) { $0 == " " }
if nameArray.count >= 2 {
return true
}
return false
}
func errorMessage() -> String {
return message
}
}

View File

@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>me.jeffpotter.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>

View File

@ -1,34 +0,0 @@
//
// LengthRule.swift
// Validator
//
// Created by Jeff Potter on 3/6/15.
// Copyright (c) 2015 jpotts18. All rights reserved.
//
import Foundation
class MinLengthRule : Rule {
private let DEFAULT_MIN_LENGTH: Int
init(){
DEFAULT_MIN_LENGTH = 3
}
init(length:Int){
self.DEFAULT_MIN_LENGTH = length
}
func validate(value: String) -> Bool {
if count(value) <= DEFAULT_MIN_LENGTH {
return false
}
return true
}
func errorMessage() -> String {
return "Must be at least \(DEFAULT_MIN_LENGTH) characters long"
}
}

View File

@ -1,44 +0,0 @@
//
// PasswordValidation.swift
// Pingo
//
// Created by Jeff Potter on 11/13/14.
// Copyright (c) 2014 Byron Mackay. All rights reserved.
//
import Foundation
class PasswordRule : Rule {
// Alternative Regexes
// 8 characters. One uppercase. One Lowercase. One number.
// var PASSWORD_REGEX = "^(?=.*?[A-Z])(?=.*?[0-9])(?=.*?[a-z]).{8,}$"
//
// no length. One uppercase. One lowercae. One number.
// var PASSWORD_REGEX = "^(?=.*?[A-Z])(?=.*?[0-9])(?=.*?[a-z]).*?$"
// 8 characters. one uppercase
private let REGEX: String
init(){
self.REGEX = "^(?=.*?[A-Z]).{8,}$"
}
init(regex:String){
self.REGEX = regex
}
func validate(value: String) -> Bool {
let test = NSPredicate(format: "SELF MATCHES %@", self.REGEX)
if test.evaluateWithObject(value) {
return true
}
return false
}
func errorMessage() -> String {
return "Must be 8 characters with 1 uppercase"
}
}

View File

@ -1,33 +0,0 @@
//
// PhoneValidation.swift
// Pingo
//
// Created by Jeff Potter on 11/11/14.
// Copyright (c) 2014 Byron Mackay. All rights reserved.
//
import Foundation
class PhoneNumberRule: Rule {
// let PHONE_REGEX = "^\\d{3}-\\d{3}-\\d{4}$"
let PHONE_REGEX = "^\\d{10}$"
var message:String {
return "Enter a valid 10 digit phone number"
}
func validate(value: String) -> Bool {
if let phoneTest = NSPredicate(format: "SELF MATCHES %@", PHONE_REGEX) {
if phoneTest.evaluateWithObject(value) {
return true
}
return false
}
return false
}
func errorMessage() -> String {
return message
}
}

View File

@ -1,30 +0,0 @@
//
// Required.swift
// pyur-ios
//
// Created by Jeff Potter on 12/22/14.
// Copyright (c) 2014 ringseven. All rights reserved.
//
import Foundation
class RequiredRule: Rule {
init(){}
var message: String {
return "This field is required"
}
func validate(value:String) -> Bool {
if value.isEmpty {
return false
}
return true
}
func errorMessage() -> String {
return message
}
}

View File

@ -1,14 +0,0 @@
//
// Validation.swift
// Pingo
//
// Created by Jeff Potter on 11/11/14.
// Copyright (c) 2014 Byron Mackay. All rights reserved.
//
import Foundation
protocol Rule {
func validate(value:String) -> Bool
func errorMessage() -> String
}

View File

@ -1,22 +0,0 @@
//
// File.swift
// Pingo
//
// Created by Jeff Potter on 11/11/14.
// Copyright (c) 2014 Byron Mackay. All rights reserved.
//
import Foundation
import UIKit
class ValidationError {
let textField:UITextField
var errorLabel:UILabel?
let errorMessage:String
init(textField:UITextField, error:String){
self.textField = textField
self.errorMessage = error
}
}

View File

@ -1,33 +0,0 @@
//
// ValidationRule.swift
// Pingo
//
// Created by Jeff Potter on 11/11/14.
// Copyright (c) 2014 Byron Mackay. All rights reserved.
//
import Foundation
import UIKit
class ValidationRule {
var textField:UITextField
var errorLabel:UILabel?
var rules:[Rule] = []
init(textField: UITextField, rules:[Rule], errorLabel:UILabel?){
self.textField = textField
self.errorLabel = errorLabel
self.rules = rules
}
func validateField() -> ValidationError? {
for rule in rules {
var isValid:Bool = rule.validate(textField.text)
if !isValid {
return ValidationError(textField: self.textField, error: rule.errorMessage())
}
}
return nil
}
}

View File

@ -1,60 +0,0 @@
//
// Validator.swift
// Pingo
//
// Created by Jeff Potter on 11/10/14.
// Copyright (c) 2014 Byron Mackay. All rights reserved.
//
import Foundation
import UIKit
@objc protocol ValidationDelegate {
func validationWasSuccessful()
func validationFailed(errors:[UITextField:ValidationError])
}
class Validator {
// dictionary to handle complex view hierarchies like dynamic tableview cells
var errors:[UITextField:ValidationError] = [:]
var validations:[UITextField:ValidationRule] = [:]
init(){}
// MARK: Using Keys
func registerField(textField:UITextField, rules:[Rule]) {
validations[textField] = ValidationRule(textField: textField, rules: rules, errorLabel: nil)
}
func registerField(textField:UITextField, errorLabel:UILabel, rules:[Rule]) {
validations[textField] = ValidationRule(textField: textField, rules:rules, errorLabel:errorLabel)
}
func validateAll(delegate:ValidationDelegate) {
for field in validations.keys {
if let currentRule:ValidationRule = validations[field] {
if var error:ValidationError = currentRule.validateField() {
if (currentRule.errorLabel != nil) {
error.errorLabel = currentRule.errorLabel
}
errors[field] = error
} else {
errors.removeValueForKey(field)
}
}
}
if errors.isEmpty {
delegate.validationWasSuccessful()
} else {
delegate.validationFailed(errors)
}
}
func clearErrors(){
self.errors = [:]
}
}

View File

@ -8,7 +8,7 @@
import Foundation
import UIKit
import SwiftValidator
class ViewController: UIViewController , ValidationDelegate, UITextFieldDelegate {
@ -31,76 +31,69 @@ class ViewController: UIViewController , ValidationDelegate, UITextFieldDelegate
override func viewDidLoad() {
super.viewDidLoad()
self.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: "hideKeyboard"))
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()])
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
@IBAction func submitTapped(_ sender: AnyObject) {
print("Validating...")
validator.validate(self)
}
@IBAction func submitTapped(sender: AnyObject) {
println("Validating...")
self.clearErrors()
validator.validateAll(self)
}
// MARK: Error Styling
func removeError(label:UILabel, textField:UITextField) {
label.hidden = true
textField.layer.borderWidth = 0.0
}
func removeAllErrors(){
removeError(fullNameErrorLabel, textField: fullNameTextField)
removeError(emailErrorLabel, textField: emailTextField)
removeError(phoneNumberErrorLabel, textField: phoneNumberTextField)
removeError(zipcodeErrorLabel, textField: zipcodeTextField)
}
// MARK: ValidationDelegate Methods
func validationWasSuccessful() {
println("Validation Success!")
var alert = UIAlertController(title: "Success", message: "You are validated!", preferredStyle: UIAlertControllerStyle.Alert)
var defaultAction = UIAlertAction(title: "OK", style: .Default, handler: nil)
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.presentViewController(alert, animated: true, completion: nil)
self.present(alert, animated: true, completion: nil)
}
func validationFailed(errors:[UITextField:ValidationError]) {
println("Validation FAILED!")
self.setErrors()
func validationFailed(_ errors:[(Validatable, ValidationError)]) {
print("Validation FAILED!")
}
private func setErrors(){
for (field, error) in validator.errors {
field.layer.borderColor = UIColor.redColor().CGColor
field.layer.borderWidth = 1.0
error.errorLabel?.text = error.errorMessage
error.errorLabel?.hidden = false
}
}
private func clearErrors(){
for (field, error) in validator.errors {
field.layer.borderWidth = 0.0
error.errorLabel?.hidden = true
}
}
func hideKeyboard(){
@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,33 +0,0 @@
//
// ZipCodeRule.swift
// Validator
//
// Created by Jeff Potter on 3/6/15.
// Copyright (c) 2015 jpotts18. All rights reserved.
//
import Foundation
class ZipCodeRule: Rule {
private let REGEX: String
init(){
self.REGEX = "\\d{5}"
}
init(regex:String){
self.REGEX = regex
}
func validate(value: String) -> Bool {
let test = NSPredicate(format: "SELF MATCHES %@", self.REGEX)
if test.evaluateWithObject(value) {
return true
}
return false
}
func errorMessage() -> String {
return "Enter a valid 5 digit zipcode"
}
}

View File

@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>me.jeffpotter.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>

View File

@ -1,36 +0,0 @@
//
// ValidatorTests.swift
// ValidatorTests
//
// Created by Jeff Potter on 11/20/14.
// Copyright (c) 2014 jpotts18. All rights reserved.
//
import UIKit
import XCTest
class ValidatorTests: XCTestCase {
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()
}
func testExample() {
// This is an example of a functional test case.
XCTAssert(true, "Pass")
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measureBlock() {
// Put the code you want to measure the time of here.
}
}
}

804
docs/Classes.html Normal file
View File

@ -0,0 +1,804 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Classes Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset='utf-8'>
<script src="js/jquery.min.js" defer></script>
<script src="js/jazzy.js" defer></script>
</head>
<body>
<a title="Classes Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="index.html">SwiftValidator Reference</a>
<img id="carat" src="img/carat.png" />
Classes Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>Classes</h1>
<p>The following classes are available globally.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator9EmailRule"></a>
<a name="//apple_ref/swift/Class/EmailRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator9EmailRule">EmailRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>EmailRule</code> is a subclass of RegexRule that defines how a email is validated.</p>
<a href="Classes/EmailRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">EmailRule</span><span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator12FullNameRule"></a>
<a name="//apple_ref/swift/Class/FullNameRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator12FullNameRule">FullNameRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>FullNameRule</code> is a subclass of Rule that defines how a full name is validated.</p>
<a href="Classes/FullNameRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">FullNameRule</span> <span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator11ZipCodeRule"></a>
<a name="//apple_ref/swift/Class/ZipCodeRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator11ZipCodeRule">ZipCodeRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>ZipCodeRule</code> is a subclass of <code><a href="Classes/RegexRule.html">RegexRule</a></code> that represents how zip codes are to be validated.</p>
<a href="Classes/ZipCodeRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ZipCodeRule</span><span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator12PasswordRule"></a>
<a name="//apple_ref/swift/Class/PasswordRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator12PasswordRule">PasswordRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>PasswordRule</code> is a subclass of RegexRule that defines how a password is validated.</p>
<a href="Classes/PasswordRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">PasswordRule</span> <span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator16AlphaNumericRule"></a>
<a name="//apple_ref/swift/Class/AlphaNumericRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator16AlphaNumericRule">AlphaNumericRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>AlphaNumericRule</code> is a subclass of <code><a href="Classes/CharacterSetRule.html">CharacterSetRule</a></code>. It is used to verify that a field has a
valid list of alphanumeric characters.</p>
<a href="Classes/AlphaNumericRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">AlphaNumericRule</span><span class="p">:</span> <span class="kt">CharacterSetRule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator16CharacterSetRule"></a>
<a name="//apple_ref/swift/Class/CharacterSetRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator16CharacterSetRule">CharacterSetRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>CharacterSetRule</code> is a subclass of <code><a href="Protocols/Rule.html">Rule</a></code>. It is used to validate IPV4 address fields.</p>
<a href="Classes/CharacterSetRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">CharacterSetRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator15PhoneNumberRule"></a>
<a name="//apple_ref/swift/Class/PhoneNumberRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator15PhoneNumberRule">PhoneNumberRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>PhoneNumberRule</code> is a subclass of Rule that defines how a phone number is validated.</p>
<a href="Classes/PhoneNumberRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">PhoneNumberRule</span><span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator9FloatRule"></a>
<a name="//apple_ref/swift/Class/FloatRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator9FloatRule">FloatRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>FloatRule</code> is a subclass of Rule that defines how check if a value is a floating point value.</p>
<a href="Classes/FloatRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">FloatRule</span><span class="p">:</span><span class="kt">Rule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator12HexColorRule"></a>
<a name="//apple_ref/swift/Class/HexColorRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator12HexColorRule">HexColorRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>HexColorRule</code> is a subclass of <code><a href="Classes/RegexRule.html">RegexRule</a></code>. It is used to verify whether a field is a hexadecimal color.</p>
<a href="Classes/HexColorRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">HexColorRule</span><span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator9Validator"></a>
<a name="//apple_ref/swift/Class/Validator" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator9Validator">Validator</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Class that makes <code>Validator</code> objects. Should be added as a parameter to ViewController that will display
validation fields.</p>
<a href="Classes/Validator.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">Validator</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator14ValidationRule"></a>
<a name="//apple_ref/swift/Class/ValidationRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator14ValidationRule">ValidationRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>ValidationRule</code> is a class that creates an object which holds validation info of a text field.</p>
<a href="Classes/ValidationRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ValidationRule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator16ConfirmationRule"></a>
<a name="//apple_ref/swift/Class/ConfirmationRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator16ConfirmationRule">ConfirmationRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>ConfirmationRule</code> is a subclass of Rule that defines how a text field that has to be equal
to another text field is validated.</p>
<a href="Classes/ConfirmationRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ConfirmationRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator8IPV4Rule"></a>
<a name="//apple_ref/swift/Class/IPV4Rule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator8IPV4Rule">IPV4Rule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>IPV4Rule</code> is a subclass of RegexRule that defines how a IPV4 address validated.</p>
<a href="Classes/IPV4Rule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">IPV4Rule</span><span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator8ISBNRule"></a>
<a name="//apple_ref/swift/Class/ISBNRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator8ISBNRule">ISBNRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>ISBNRule</code> is a subclass of <code><a href="Protocols/Rule.html">Rule</a></code>. It is used to verify whether a field is a valid ISBN number.</p>
<a href="Classes/ISBNRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ISBNRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator15ValidationError"></a>
<a name="//apple_ref/swift/Class/ValidationError" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator15ValidationError">ValidationError</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The <code>ValidationError</code> class is used for representing errors of a failed validation. It contains the text field, error label, and error message of a failed validation.</p>
<a href="Classes/ValidationError.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ValidationError</span><span class="p">:</span> <span class="kt">NSObject</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator12RequiredRule"></a>
<a name="//apple_ref/swift/Class/RequiredRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator12RequiredRule">RequiredRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>RequiredRule</code> is a subclass of Rule that defines how a required text field is validated.</p>
<a href="Classes/RequiredRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">RequiredRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator9RegexRule"></a>
<a name="//apple_ref/swift/Class/RegexRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator9RegexRule">RegexRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>RegexRule</code> is a subclass of Rule that defines how a regular expression is validated.</p>
<a href="Classes/RegexRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">RegexRule</span> <span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator9AlphaRule"></a>
<a name="//apple_ref/swift/Class/AlphaRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator9AlphaRule">AlphaRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>AlphaRule</code> is a subclass of <code><a href="Classes/CharacterSetRule.html">CharacterSetRule</a></code>. It is used to verify that a field has a
valid list of alpha characters.</p>
<a href="Classes/AlphaRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">AlphaRule</span><span class="p">:</span> <span class="kt">CharacterSetRule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator13MinLengthRule"></a>
<a name="//apple_ref/swift/Class/MinLengthRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator13MinLengthRule">MinLengthRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>MinLengthRule</code> is a subclass of Rule that defines how minimum character length is validated.</p>
<a href="Classes/MinLengthRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">MinLengthRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator13MaxLengthRule"></a>
<a name="//apple_ref/swift/Class/MaxLengthRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator13MaxLengthRule">MaxLengthRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>MaxLengthRule</code> is a subclass of <code><a href="Protocols/Rule.html">Rule</a></code> that defines how maximum character length is validated.</p>
<a href="Classes/MaxLengthRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">MaxLengthRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator15ExactLengthRule"></a>
<a name="//apple_ref/swift/Class/ExactLengthRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator15ExactLengthRule">ExactLengthRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>ExactLengthRule</code> is a subclass of Rule that is used to make sure a the text of a text field is an exact length.</p>
<a href="Classes/ExactLengthRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ExactLengthRule</span> <span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

View File

@ -0,0 +1,192 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>AlphaNumericRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/AlphaNumericRule" class="dashAnchor"></a>
<a title="AlphaNumericRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
AlphaNumericRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>AlphaNumericRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">AlphaNumericRule</span><span class="p">:</span> <span class="kt">CharacterSetRule</span></code></pre>
</div>
</div>
<p><code>AlphaNumericRule</code> is a subclass of <code><a href="../Classes/CharacterSetRule.html">CharacterSetRule</a></code>. It is used to verify that a field has a
valid list of alphanumeric characters.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator16AlphaNumericRulecFMS0_FT7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator16AlphaNumericRulecFMS0_FT7messageSS_S0_">init(message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes a <code><a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a></code> object to verify that field has valid set of alphanumeric characters.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Enter valid numeric characters"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>String of error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

192
docs/Classes/AlphaRule.html Normal file
View File

@ -0,0 +1,192 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>AlphaRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/AlphaRule" class="dashAnchor"></a>
<a title="AlphaRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
AlphaRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>AlphaRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">AlphaRule</span><span class="p">:</span> <span class="kt">CharacterSetRule</span></code></pre>
</div>
</div>
<p><code>AlphaRule</code> is a subclass of <code><a href="../Classes/CharacterSetRule.html">CharacterSetRule</a></code>. It is used to verify that a field has a
valid list of alpha characters.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator9AlphaRulecFMS0_FT7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator9AlphaRulecFMS0_FT7messageSS_S0_">init(message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes an <code><a href="../Classes/AlphaRule.html">AlphaRule</a></code> object to verify that a field has valid set of alpha characters.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Enter valid alphabetic characters"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>String of error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized object, or nil if an object could not be created for some reason.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

View File

@ -0,0 +1,288 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>CharacterSetRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/CharacterSetRule" class="dashAnchor"></a>
<a title="CharacterSetRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
CharacterSetRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>CharacterSetRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">CharacterSetRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
<p><code>CharacterSetRule</code> is a subclass of <code><a href="../Protocols/Rule.html">Rule</a></code>. It is used to validate IPV4 address fields.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator16CharacterSetRulecFMS0_FT12characterSetCSo14NSCharacterSet7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(characterSet:message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator16CharacterSetRulecFMS0_FT12characterSetCSo14NSCharacterSet7messageSS_S0_">init(characterSet:message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes a <code><a href="../Classes/CharacterSetRule.html">CharacterSetRule</a></code> object to verify that field has valid set of characters.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">characterSet</span><span class="p">:</span> <span class="kt">NSCharacterSet</span><span class="p">,</span> <span class="nv">message</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Enter valid alpha"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>characterSet</em>
</code>
</td>
<td>
<div>
<p>NSCharacterSet that holds group of valid characters.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>String of error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator16CharacterSetRule8validateFS0_FSSSb"></a>
<a name="//apple_ref/swift/Method/validate(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator16CharacterSetRule8validateFS0_FSSSb">validate(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Used to validate field.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="nv">value</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>value</em>
</code>
</td>
<td>
<div>
<p>String to checked for validation.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>Boolean value. True if validation is successful; False if validation fails.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator16CharacterSetRule12errorMessageFS0_FT_SS"></a>
<a name="//apple_ref/swift/Method/errorMessage()" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator16CharacterSetRule12errorMessageFS0_FT_SS">errorMessage()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Displays error message when text field fails validation.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">errorMessage</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">String</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>String of error message.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

View File

@ -0,0 +1,289 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>ConfirmationRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/ConfirmationRule" class="dashAnchor"></a>
<a title="ConfirmationRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
ConfirmationRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>ConfirmationRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ConfirmationRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
<p><code>ConfirmationRule</code> is a subclass of Rule that defines how a text field that has to be equal
to another text field is validated.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator16ConfirmationRulecFMS0_FT12confirmFieldCSo11UITextField7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(confirmField:message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator16ConfirmationRulecFMS0_FT12confirmFieldCSo11UITextField7messageSS_S0_">init(confirmField:message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes a <code><a href="../Classes/ConfirmationRule.html">ConfirmationRule</a></code> object to validate the text of a text field that should equal the text of another text field.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">confirmField</span><span class="p">:</span> <span class="kt">UITextField</span><span class="p">,</span> <span class="nv">message</span> <span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"This field does not match"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>confirmField</em>
</code>
</td>
<td>
<div>
<p>text field to which original text field will be compared to.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>String of error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator16ConfirmationRule8validateFS0_FSSSb"></a>
<a name="//apple_ref/swift/Method/validate(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator16ConfirmationRule8validateFS0_FSSSb">validate(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Used to validate a text field.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="nv">value</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>value</em>
</code>
</td>
<td>
<div>
<p>String to checked for validation.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>A boolean value. True if validation is successful; False if validation fails.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator16ConfirmationRule12errorMessageFS0_FT_SS"></a>
<a name="//apple_ref/swift/Method/errorMessage()" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator16ConfirmationRule12errorMessageFS0_FT_SS">errorMessage()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Displays an error message when text field fails validation.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">errorMessage</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">String</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>String of error message.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

191
docs/Classes/EmailRule.html Normal file
View File

@ -0,0 +1,191 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>EmailRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/EmailRule" class="dashAnchor"></a>
<a title="EmailRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
EmailRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>EmailRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">EmailRule</span><span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
</div>
</div>
<p><code>EmailRule</code> is a subclass of RegexRule that defines how a email is validated.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator9EmailRulecFMS0_FT7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator9EmailRulecFMS0_FT7messageSS_S0_">init(message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes an <code><a href="../Classes/EmailRule.html">EmailRule</a></code> object to validate an email text field.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="n">convenience</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span> <span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Must be a valid email address"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>String of error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

View File

@ -0,0 +1,288 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>ExactLengthRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/ExactLengthRule" class="dashAnchor"></a>
<a title="ExactLengthRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
ExactLengthRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>ExactLengthRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ExactLengthRule</span> <span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
<p><code>ExactLengthRule</code> is a subclass of Rule that is used to make sure a the text of a text field is an exact length.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator15ExactLengthRulecFMS0_FT6lengthSi7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(length:message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator15ExactLengthRulecFMS0_FT6lengthSi7messageSS_S0_">init(length:message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes an <code><a href="../Classes/ExactLengthRule.html">ExactLengthRule</a></code> object to validate the text of a text field against an exact length.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">length</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">message</span> <span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Must be exactly %ld characters long"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>length</em>
</code>
</td>
<td>
<div>
<p>Integer value of exact string length being specified.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>String of error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized <code><a href="../Classes/ExactLengthRule.html">ExactLengthRule</a></code> object, or nil if an object could not be created for some reason. that would not result in an exception.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator15ExactLengthRule8validateFS0_FSSSb"></a>
<a name="//apple_ref/swift/Method/validate(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator15ExactLengthRule8validateFS0_FSSSb">validate(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Used to validate a text field.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="nv">value</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>value</em>
</code>
</td>
<td>
<div>
<p>String to checked for validation.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>A boolean value. True if validation is successful; False if validation fails.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator15ExactLengthRule12errorMessageFS0_FT_SS"></a>
<a name="//apple_ref/swift/Method/errorMessage()" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator15ExactLengthRule12errorMessageFS0_FT_SS">errorMessage()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Displays error message if a text field fails validation.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">errorMessage</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">String</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>String of error message.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

275
docs/Classes/FloatRule.html Normal file
View File

@ -0,0 +1,275 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>FloatRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/FloatRule" class="dashAnchor"></a>
<a title="FloatRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
FloatRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>FloatRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">FloatRule</span><span class="p">:</span><span class="kt">Rule</span></code></pre>
</div>
</div>
<p><code>FloatRule</code> is a subclass of Rule that defines how check if a value is a floating point value.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator9FloatRulecFMS0_FT7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator9FloatRulecFMS0_FT7messageSS_S0_">init(message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes a <code><a href="../Classes/FloatRule.html">FloatRule</a></code> object to validate that the text of a text field is a floating point number.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span> <span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"This must be a number with or without a decimal"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>String of error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator9FloatRule8validateFS0_FSSSb"></a>
<a name="//apple_ref/swift/Method/validate(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator9FloatRule8validateFS0_FSSSb">validate(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Used to validate text field.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="nv">value</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>value</em>
</code>
</td>
<td>
<div>
<p>String to checked for validation.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>Boolean value. True if validation is successful; False if validation fails.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator9FloatRule12errorMessageFS0_FT_SS"></a>
<a name="//apple_ref/swift/Method/errorMessage()" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator9FloatRule12errorMessageFS0_FT_SS">errorMessage()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Displays error message when text field fails validation.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">errorMessage</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">String</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>String of error message.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

View File

@ -0,0 +1,275 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>FullNameRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/FullNameRule" class="dashAnchor"></a>
<a title="FullNameRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
FullNameRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>FullNameRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">FullNameRule</span> <span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
<p><code>FullNameRule</code> is a subclass of Rule that defines how a full name is validated.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator12FullNameRulecFMS0_FT7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator12FullNameRulecFMS0_FT7messageSS_S0_">init(message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes a <code><a href="../Classes/FullNameRule.html">FullNameRule</a></code> object that is used to verify that text in text field is a full name.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span> <span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Please provide a first &amp; last name"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>String of error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized <code><a href="../Classes/FullNameRule.html">FullNameRule</a></code> object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator12FullNameRule8validateFS0_FSSSb"></a>
<a name="//apple_ref/swift/Method/validate(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator12FullNameRule8validateFS0_FSSSb">validate(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Used to validate a text field.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="nv">value</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>value</em>
</code>
</td>
<td>
<div>
<p>String to checked for validation.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>A boolean value. True if validation is successful; False if validation fails.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator12FullNameRule12errorMessageFS0_FT_SS"></a>
<a name="//apple_ref/swift/Method/errorMessage()" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator12FullNameRule12errorMessageFS0_FT_SS">errorMessage()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Used to display error message of a text field that has failed validation.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">errorMessage</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">String</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>String of error message.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

View File

@ -0,0 +1,191 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>HexColorRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/HexColorRule" class="dashAnchor"></a>
<a title="HexColorRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
HexColorRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>HexColorRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">HexColorRule</span><span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
</div>
</div>
<p><code>HexColorRule</code> is a subclass of <code><a href="../Classes/RegexRule.html">RegexRule</a></code>. It is used to verify whether a field is a hexadecimal color.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator12HexColorRulecFMS0_FT7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator12HexColorRulecFMS0_FT7messageSS_S0_">init(message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes a <code>HexaColorRule</code> object to verify that field has text in hexadecimal color format.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Invalid regular expression"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>String of error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

191
docs/Classes/IPV4Rule.html Normal file
View File

@ -0,0 +1,191 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>IPV4Rule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/IPV4Rule" class="dashAnchor"></a>
<a title="IPV4Rule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
IPV4Rule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>IPV4Rule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">IPV4Rule</span><span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
</div>
</div>
<p><code>IPV4Rule</code> is a subclass of RegexRule that defines how a IPV4 address validated.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator8IPV4RulecFMS0_FT7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator8IPV4RulecFMS0_FT7messageSS_S0_">init(message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes a <code><a href="../Classes/IPV4Rule.html">IPV4Rule</a></code> object to verify that field has text is an IPV4Rule address.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Must be a valid IPV4 address"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>String of error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

275
docs/Classes/ISBNRule.html Normal file
View File

@ -0,0 +1,275 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>ISBNRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/ISBNRule" class="dashAnchor"></a>
<a title="ISBNRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
ISBNRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>ISBNRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ISBNRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
<p><code>ISBNRule</code> is a subclass of <code><a href="../Protocols/Rule.html">Rule</a></code>. It is used to verify whether a field is a valid ISBN number.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator8ISBNRulecFMS0_FT7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator8ISBNRulecFMS0_FT7messageSS_S0_">init(message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes a <code><a href="../Classes/ISBNRule.html">ISBNRule</a></code> object to verify that field has text that is a ISBN number.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Enter valid ISBN number"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>String of error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator8ISBNRule8validateFS0_FSSSb"></a>
<a name="//apple_ref/swift/Method/validate(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator8ISBNRule8validateFS0_FSSSb">validate(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Method used to validate text field.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="nv">value</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>value</em>
</code>
</td>
<td>
<div>
<p>String to checked for validation.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>Boolean value. True if validation is successful; False if validation fails.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator8ISBNRule12errorMessageFS0_FT_SS"></a>
<a name="//apple_ref/swift/Method/errorMessage()" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator8ISBNRule12errorMessageFS0_FT_SS">errorMessage()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Method used to dispaly error message when text field fails validation.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">errorMessage</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">String</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>String of error message.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

View File

@ -0,0 +1,319 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>MaxLengthRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/MaxLengthRule" class="dashAnchor"></a>
<a title="MaxLengthRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
MaxLengthRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>MaxLengthRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">MaxLengthRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
<p><code>MaxLengthRule</code> is a subclass of <code><a href="../Protocols/Rule.html">Rule</a></code> that defines how maximum character length is validated.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator13MaxLengthRulecFMS0_FT_S0_"></a>
<a name="//apple_ref/swift/Method/init()" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator13MaxLengthRulecFMS0_FT_S0_">init()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(){}</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized <code><a href="../Classes/MaxLengthRule.html">MaxLengthRule</a></code> object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator13MaxLengthRulecFMS0_FT6lengthSi7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(length:message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator13MaxLengthRulecFMS0_FT6lengthSi7messageSS_S0_">init(length:message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes a <code><a href="../Classes/MaxLengthRule.html">MaxLengthRule</a></code> object that is to validate the length of the text of a text field.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">length</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">message</span> <span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Must be at most %ld characters long"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>length</em>
</code>
</td>
<td>
<div>
<p>Maximum character length.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>String of error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator13MaxLengthRule8validateFS0_FSSSb"></a>
<a name="//apple_ref/swift/Method/validate(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator13MaxLengthRule8validateFS0_FSSSb">validate(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Used to validate a text field.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="nv">value</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>value</em>
</code>
</td>
<td>
<div>
<p>String to checked for validation.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>A boolean value. True if validation is successful; False if validation fails.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator13MaxLengthRule12errorMessageFS0_FT_SS"></a>
<a name="//apple_ref/swift/Method/errorMessage()" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator13MaxLengthRule12errorMessageFS0_FT_SS">errorMessage()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Displays an error message if a text field fails validation.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">errorMessage</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">String</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>String of error message.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

View File

@ -0,0 +1,321 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>MinLengthRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/MinLengthRule" class="dashAnchor"></a>
<a title="MinLengthRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
MinLengthRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>MinLengthRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">MinLengthRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
<p><code>MinLengthRule</code> is a subclass of Rule that defines how minimum character length is validated.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator13MinLengthRulecFMS0_FT_S0_"></a>
<a name="//apple_ref/swift/Method/init()" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator13MinLengthRulecFMS0_FT_S0_">init()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(){}</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized <code><a href="../Classes/MinLengthRule.html">MinLengthRule</a></code> object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator13MinLengthRulecFMS0_FT6lengthSi7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(length:message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator13MinLengthRulecFMS0_FT6lengthSi7messageSS_S0_">init(length:message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes a <code><a href="../Classes/MaxLengthRule.html">MaxLengthRule</a></code> object that is to validate the length of the text of a text field.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">length</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">message</span> <span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Must be at least %ld characters long"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>length</em>
</code>
</td>
<td>
<div>
<p>Minimum character length.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>String of error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized <code><a href="../Classes/MinLengthRule.html">MinLengthRule</a></code> object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator13MinLengthRule8validateFS0_FSSSb"></a>
<a name="//apple_ref/swift/Method/validate(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator13MinLengthRule8validateFS0_FSSSb">validate(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Validates a text field.
- parameter value: String to checked for validation.
- returns: A boolean value. True if validation is successful; False if validation fails.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="nv">value</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>value</em>
</code>
</td>
<td>
<div>
<p>String to checked for validation.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>A boolean value. True if validation is successful; False if validation fails.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator13MinLengthRule12errorMessageFS0_FT_SS"></a>
<a name="//apple_ref/swift/Method/errorMessage()" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator13MinLengthRule12errorMessageFS0_FT_SS">errorMessage()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Displays error message when text field has failed validation.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">errorMessage</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">String</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>String of error message.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

View File

@ -0,0 +1,191 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>PasswordRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/PasswordRule" class="dashAnchor"></a>
<a title="PasswordRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
PasswordRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>PasswordRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">PasswordRule</span> <span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
</div>
</div>
<p><code>PasswordRule</code> is a subclass of RegexRule that defines how a password is validated.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator12PasswordRulecFMS0_FT7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator12PasswordRulecFMS0_FT7messageSS_S0_">init(message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes a <code><a href="../Classes/PasswordRule.html">PasswordRule</a></code> object that will validate a text field is a valid password.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="n">convenience</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span> <span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Must be 8 characters with 1 uppercase"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>String of error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized <code><a href="../Classes/PasswordRule.html">PasswordRule</a></code> object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

View File

@ -0,0 +1,191 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>PhoneNumberRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/PhoneNumberRule" class="dashAnchor"></a>
<a title="PhoneNumberRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
PhoneNumberRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>PhoneNumberRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">PhoneNumberRule</span><span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
</div>
</div>
<p><code>PhoneNumberRule</code> is a subclass of Rule that defines how a phone number is validated.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator15PhoneNumberRulecFMS0_FT7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator15PhoneNumberRulecFMS0_FT7messageSS_S0_">init(message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes a <code><a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a></code> object. Used to validate that a field has a valid phone number.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="n">convenience</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span> <span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Enter a valid 10 digit phone number"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>Error message that is displayed if validation fails.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized <code><a href="../Classes/PasswordRule.html">PasswordRule</a></code> object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

288
docs/Classes/RegexRule.html Normal file
View File

@ -0,0 +1,288 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>RegexRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/RegexRule" class="dashAnchor"></a>
<a title="RegexRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
RegexRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>RegexRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">RegexRule</span> <span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
<p><code>RegexRule</code> is a subclass of Rule that defines how a regular expression is validated.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator9RegexRulecFMS0_FT5regexSS7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(regex:message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator9RegexRulecFMS0_FT5regexSS7messageSS_S0_">init(regex:message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Method used to initialize <code><a href="../Classes/RegexRule.html">RegexRule</a></code> object.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">regex</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">message</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Invalid Regular Expression"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>regex</em>
</code>
</td>
<td>
<div>
<p>Regular expression string to be used in validation.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>String of error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized <code><a href="../Classes/RegexRule.html">RegexRule</a></code> object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator9RegexRule8validateFS0_FSSSb"></a>
<a name="//apple_ref/swift/Method/validate(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator9RegexRule8validateFS0_FSSSb">validate(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Method used to validate text field.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="nv">value</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>value</em>
</code>
</td>
<td>
<div>
<p>String to checked for validation.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>Boolean value. True if validation is successful; False if validation fails.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator9RegexRule12errorMessageFS0_FT_SS"></a>
<a name="//apple_ref/swift/Method/errorMessage()" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator9RegexRule12errorMessageFS0_FT_SS">errorMessage()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Method used to dispaly error message when text field fails validation.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">errorMessage</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">String</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>String of error message.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

View File

@ -0,0 +1,275 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>RequiredRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/RequiredRule" class="dashAnchor"></a>
<a title="RequiredRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
RequiredRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>RequiredRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">RequiredRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
<p><code>RequiredRule</code> is a subclass of Rule that defines how a required text field is validated.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator12RequiredRulecFMS0_FT7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator12RequiredRulecFMS0_FT7messageSS_S0_">init(message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes <code><a href="../Classes/RequiredRule.html">RequiredRule</a></code> object with error message. Used to validate a field that requires text.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span> <span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"This field is required"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>String of error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized <code><a href="../Classes/RequiredRule.html">RequiredRule</a></code> object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator12RequiredRule8validateFS0_FSSSb"></a>
<a name="//apple_ref/swift/Method/validate(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator12RequiredRule8validateFS0_FSSSb">validate(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Validates a text field.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="nv">value</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>value</em>
</code>
</td>
<td>
<div>
<p>String to checked for validation.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>Boolean value. True if validation is successful; False if validation fails.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator12RequiredRule12errorMessageFS0_FT_SS"></a>
<a name="//apple_ref/swift/Method/errorMessage()" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator12RequiredRule12errorMessageFS0_FT_SS">errorMessage()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Used to display error message when validation fails.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">errorMessage</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">String</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>String of error message.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

View File

@ -0,0 +1,363 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>ValidationError Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/ValidationError" class="dashAnchor"></a>
<a title="ValidationError Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
ValidationError Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>ValidationError</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ValidationError</span><span class="p">:</span> <span class="kt">NSObject</span></code></pre>
</div>
</div>
<p>The <code>ValidationError</code> class is used for representing errors of a failed validation. It contains the text field, error label, and error message of a failed validation.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:vC14SwiftValidator15ValidationError9textFieldCSo11UITextField"></a>
<a name="//apple_ref/swift/Property/textField" class="dashAnchor"></a>
<a class="token" href="#/s:vC14SwiftValidator15ValidationError9textFieldCSo11UITextField">textField</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>the textField of the field</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">textField</span><span class="p">:</span><span class="kt">UITextField</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC14SwiftValidator15ValidationError10errorLabelGSqCSo7UILabel_"></a>
<a name="//apple_ref/swift/Property/errorLabel" class="dashAnchor"></a>
<a class="token" href="#/s:vC14SwiftValidator15ValidationError10errorLabelGSqCSo7UILabel_">errorLabel</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>the error label of the field</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">errorLabel</span><span class="p">:</span><span class="kt">UILabel</span><span class="p">?</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC14SwiftValidator15ValidationError12errorMessageSS"></a>
<a name="//apple_ref/swift/Property/errorMessage" class="dashAnchor"></a>
<a class="token" href="#/s:vC14SwiftValidator15ValidationError12errorMessageSS">errorMessage</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>the error message of the field</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">errorMessage</span><span class="p">:</span><span class="kt">String</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator15ValidationErrorcFMS0_FT9textFieldCSo11UITextField5errorSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(textField:error:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator15ValidationErrorcFMS0_FT9textFieldCSo11UITextField5errorSS_S0_">init(textField:error:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes <code><a href="../Classes/ValidationError.html">ValidationError</a></code> object with a textField and error.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">textField</span><span class="p">:</span><span class="kt">UITextField</span><span class="p">,</span> <span class="nv">error</span><span class="p">:</span><span class="kt">String</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>textField</em>
</code>
</td>
<td>
<div>
<p>UITextField that holds textField.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>errorMessage</em>
</code>
</td>
<td>
<div>
<p>String that holds error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator15ValidationErrorcFMS0_FT9textFieldCSo11UITextField10errorLabelGSqCSo7UILabel_5errorSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(textField:errorLabel:error:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator15ValidationErrorcFMS0_FT9textFieldCSo11UITextField10errorLabelGSqCSo7UILabel_5errorSS_S0_">init(textField:errorLabel:error:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes <code><a href="../Classes/ValidationError.html">ValidationError</a></code> object with a textField, errorLabel, and errorMessage.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">textField</span><span class="p">:</span><span class="kt">UITextField</span><span class="p">,</span> <span class="nv">errorLabel</span><span class="p">:</span><span class="kt">UILabel</span><span class="p">?,</span> <span class="nv">error</span><span class="p">:</span><span class="kt">String</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>textField</em>
</code>
</td>
<td>
<div>
<p>UITextField that holds textField.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>errorLabel</em>
</code>
</td>
<td>
<div>
<p>UILabel that holds error label.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>errorMessage</em>
</code>
</td>
<td>
<div>
<p>String that holds error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

View File

@ -0,0 +1,331 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>ValidationRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/ValidationRule" class="dashAnchor"></a>
<a title="ValidationRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
ValidationRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>ValidationRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ValidationRule</span></code></pre>
</div>
</div>
<p><code>ValidationRule</code> is a class that creates an object which holds validation info of a text field.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:vC14SwiftValidator14ValidationRule9textFieldCSo11UITextField"></a>
<a name="//apple_ref/swift/Property/textField" class="dashAnchor"></a>
<a class="token" href="#/s:vC14SwiftValidator14ValidationRule9textFieldCSo11UITextField">textField</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>the text field of the field</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">textField</span><span class="p">:</span><span class="kt">UITextField</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC14SwiftValidator14ValidationRule10errorLabelGSqCSo7UILabel_"></a>
<a name="//apple_ref/swift/Property/errorLabel" class="dashAnchor"></a>
<a class="token" href="#/s:vC14SwiftValidator14ValidationRule10errorLabelGSqCSo7UILabel_">errorLabel</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>the errorLabel of the field</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">errorLabel</span><span class="p">:</span><span class="kt">UILabel</span><span class="p">?</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC14SwiftValidator14ValidationRule5rulesGSaPS_4Rule__"></a>
<a name="//apple_ref/swift/Property/rules" class="dashAnchor"></a>
<a class="token" href="#/s:vC14SwiftValidator14ValidationRule5rulesGSaPS_4Rule__">rules</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>the rules of the field</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">rules</span><span class="p">:[</span><span class="kt">Rule</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator14ValidationRulecFMS0_FT9textFieldCSo11UITextField5rulesGSaPS_4Rule__10errorLabelGSqCSo7UILabel__S0_"></a>
<a name="//apple_ref/swift/Method/init(textField:rules:errorLabel:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator14ValidationRulecFMS0_FT9textFieldCSo11UITextField5rulesGSaPS_4Rule__10errorLabelGSqCSo7UILabel__S0_">init(textField:rules:errorLabel:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes <code><a href="../Classes/ValidationRule.html">ValidationRule</a></code> instance with text field, rules, and errorLabel.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">textField</span><span class="p">:</span> <span class="kt">UITextField</span><span class="p">,</span> <span class="nv">rules</span><span class="p">:[</span><span class="kt">Rule</span><span class="p">],</span> <span class="nv">errorLabel</span><span class="p">:</span><span class="kt">UILabel</span><span class="p">?)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>textField</em>
</code>
</td>
<td>
<div>
<p>text field that holds actual text in text field.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>errorLabel</em>
</code>
</td>
<td>
<div>
<p>label that holds error label of text field.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>rules</em>
</code>
</td>
<td>
<div>
<p>array of Rule objects, which text field will be validated against.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized <code><a href="../Classes/ValidationRule.html">ValidationRule</a></code> object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator14ValidationRule13validateFieldFS0_FT_GSqCS_15ValidationError_"></a>
<a name="//apple_ref/swift/Method/validateField()" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator14ValidationRule13validateFieldFS0_FT_GSqCS_15ValidationError_">validateField()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Used to validate text field against its validation rules.
- returns: <code><a href="../Classes/ValidationError.html">ValidationError</a></code> object if at least one error is found. Nil is returned if there are no validation errors.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validateField</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">ValidationError</span><span class="p">?</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p><code><a href="../Classes/ValidationError.html">ValidationError</a></code> object if at least one error is found. Nil is returned if there are no validation errors.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

644
docs/Classes/Validator.html Normal file
View File

@ -0,0 +1,644 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Validator Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/Validator" class="dashAnchor"></a>
<a title="Validator Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
Validator Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>Validator</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">Validator</span></code></pre>
</div>
</div>
<p>Class that makes <code>Validator</code> objects. Should be added as a parameter to ViewController that will display
validation fields.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:vC14SwiftValidator9Validator11validationsGVSs10DictionaryCSo11UITextFieldCS_14ValidationRule_"></a>
<a name="//apple_ref/swift/Property/validations" class="dashAnchor"></a>
<a class="token" href="#/s:vC14SwiftValidator9Validator11validationsGVSs10DictionaryCSo11UITextFieldCS_14ValidationRule_">validations</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Dictionary to hold all fields (and accompanying rules) that will undergo validation.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">validations</span> <span class="o">=</span> <span class="p">[</span><span class="kt">UITextField</span><span class="p">:</span><span class="kt">ValidationRule</span><span class="p">]()</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC14SwiftValidator9Validator6errorsGVSs10DictionaryCSo11UITextFieldCS_15ValidationError_"></a>
<a name="//apple_ref/swift/Property/errors" class="dashAnchor"></a>
<a class="token" href="#/s:vC14SwiftValidator9Validator6errorsGVSs10DictionaryCSo11UITextFieldCS_15ValidationError_">errors</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Dictionary to hold fields (and accompanying errors) that were unsuccessfully validated.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">errors</span> <span class="o">=</span> <span class="p">[</span><span class="kt">UITextField</span><span class="p">:</span><span class="kt">ValidationError</span><span class="p">]()</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator9ValidatorcFMS0_FT_S0_"></a>
<a name="//apple_ref/swift/Method/init()" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator9ValidatorcFMS0_FT_S0_">init()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(){}</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Public%20functions"></a>
<a name="//apple_ref/swift/Section/Public functions" class="dashAnchor"></a>
<a href="#/Public%20functions">
<h3 class="section-name">Public functions</h3>
</a>
</div>
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator9Validator13validateFieldFS0_FTCSo11UITextField8callbackFT5errorGSqCS_15ValidationError__T__T_"></a>
<a name="//apple_ref/swift/Method/validateField(_:callback:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator9Validator13validateFieldFS0_FTCSo11UITextField8callbackFT5errorGSqCS_15ValidationError__T__T_">validateField(_:callback:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>This method is used to validate a single field registered to Validator. If validation is unsuccessful,
field gets added to errors dictionary.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validateField</span><span class="p">(</span><span class="nv">textField</span><span class="p">:</span> <span class="kt">UITextField</span><span class="p">,</span> <span class="nv">callback</span><span class="p">:</span> <span class="p">(</span><span class="nv">error</span><span class="p">:</span><span class="kt">ValidationError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>textField</em>
</code>
</td>
<td>
<div>
<p>Holds validator field data.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>No return value.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Using%20Keys"></a>
<a name="//apple_ref/swift/Section/Using Keys" class="dashAnchor"></a>
<a href="#/Using%20Keys">
<h3 class="section-name">Using Keys</h3>
</a>
</div>
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator9Validator17styleTransformersFS0_FT7successGSqFT14validationRuleCS_14ValidationRule_T__5errorGSqFT15validationErrorCS_15ValidationError_T___T_"></a>
<a name="//apple_ref/swift/Method/styleTransformers(success:error:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator9Validator17styleTransformersFS0_FT7successGSqFT14validationRuleCS_14ValidationRule_T__5errorGSqFT15validationErrorCS_15ValidationError_T___T_">styleTransformers(success:error:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>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.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">styleTransformers</span><span class="p">(</span><span class="n">success</span> <span class="nv">success</span><span class="p">:((</span><span class="nv">validationRule</span><span class="p">:</span><span class="kt">ValidationRule</span><span class="p">)</span><span class="o">-&gt;</span><span class="kt">Void</span><span class="p">)?,</span> <span class="nv">error</span><span class="p">:((</span><span class="nv">validationError</span><span class="p">:</span><span class="kt">ValidationError</span><span class="p">)</span><span class="o">-&gt;</span><span class="kt">Void</span><span class="p">)?)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>success</em>
</code>
</td>
<td>
<div>
<p>A closure which is called with validationRule, an object that holds validation data</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>error</em>
</code>
</td>
<td>
<div>
<p>A closure which is called with validationError, an object that holds validation error data</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>No return value</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator9Validator13registerFieldFS0_FTCSo11UITextField5rulesGSaPS_4Rule___T_"></a>
<a name="//apple_ref/swift/Method/registerField(_:rules:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator9Validator13registerFieldFS0_FTCSo11UITextField5rulesGSaPS_4Rule___T_">registerField(_:rules:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>This method is used to add a field to validator.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">registerField</span><span class="p">(</span><span class="nv">textField</span><span class="p">:</span><span class="kt">UITextField</span><span class="p">,</span> <span class="nv">rules</span><span class="p">:[</span><span class="kt">Rule</span><span class="p">])</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>textField</em>
</code>
</td>
<td>
<div>
<p>field that is to be validated.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>Rule</em>
</code>
</td>
<td>
<div>
<p>An array which holds different rules to validate against textField.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>No return value</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator9Validator13registerFieldFS0_FTCSo11UITextField10errorLabelCSo7UILabel5rulesGSaPS_4Rule___T_"></a>
<a name="//apple_ref/swift/Method/registerField(_:errorLabel:rules:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator9Validator13registerFieldFS0_FTCSo11UITextField10errorLabelCSo7UILabel5rulesGSaPS_4Rule___T_">registerField(_:errorLabel:rules:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>This method is used to add a field to validator.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">registerField</span><span class="p">(</span><span class="nv">textField</span><span class="p">:</span><span class="kt">UITextField</span><span class="p">,</span> <span class="nv">errorLabel</span><span class="p">:</span><span class="kt">UILabel</span><span class="p">,</span> <span class="nv">rules</span><span class="p">:[</span><span class="kt">Rule</span><span class="p">])</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>textfield</em>
</code>
</td>
<td>
<div>
<p>field that is to be validated.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>errorLabel</em>
</code>
</td>
<td>
<div>
<p>A UILabel that holds error label data</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>rules</em>
</code>
</td>
<td>
<div>
<p>A Rule array that holds different rules that apply to said textField.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>No return value</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator9Validator15unregisterFieldFS0_FCSo11UITextFieldT_"></a>
<a name="//apple_ref/swift/Method/unregisterField(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator9Validator15unregisterFieldFS0_FCSo11UITextFieldT_">unregisterField(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>This method is for removing a field validator.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">unregisterField</span><span class="p">(</span><span class="nv">textField</span><span class="p">:</span><span class="kt">UITextField</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>textField</em>
</code>
</td>
<td>
<div>
<p>field used to locate and remove textField from validator.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>No return value</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator9Validator8validateFS0_FPS_18ValidationDelegate_T_"></a>
<a name="//apple_ref/swift/Method/validate(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator9Validator8validateFS0_FPS_18ValidationDelegate_T_">validate(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>This method checks to see if all fields in validator are valid.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="nv">delegate</span><span class="p">:</span><span class="kt">ValidationDelegate</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>No return value.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator9Validator8validateFS0_FFT6errorsGVSs10DictionaryCSo11UITextFieldCS_15ValidationError__T_T_"></a>
<a name="//apple_ref/swift/Method/validate(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator9Validator8validateFS0_FFT6errorsGVSs10DictionaryCSo11UITextFieldCS_15ValidationError__T_T_">validate(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>This method validates all fields in validator and sets any errors to errors parameter of callback.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="nv">callback</span><span class="p">:(</span><span class="nv">errors</span><span class="p">:[</span><span class="kt">UITextField</span><span class="p">:</span><span class="kt">ValidationError</span><span class="p">])</span><span class="o">-&gt;</span><span class="kt">Void</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>callback</em>
</code>
</td>
<td>
<div>
<p>A closure which is called with errors, a dictionary of type UITextField:ValidationError.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>No return value.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

View File

@ -0,0 +1,191 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>ZipCodeRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/ZipCodeRule" class="dashAnchor"></a>
<a title="ZipCodeRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
ZipCodeRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>ZipCodeRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ZipCodeRule</span><span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
</div>
</div>
<p><code>ZipCodeRule</code> is a subclass of <code><a href="../Classes/RegexRule.html">RegexRule</a></code> that represents how zip codes are to be validated.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator11ZipCodeRulecFMS0_FT7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator11ZipCodeRulecFMS0_FT7messageSS_S0_">init(message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes a <code><a href="../Classes/ZipCodeRule.html">ZipCodeRule</a></code> object.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="n">convenience</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span> <span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Enter a valid 5 digit zipcode"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>String that holds error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

192
docs/Protocols.html Normal file
View File

@ -0,0 +1,192 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Protocols Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset='utf-8'>
<script src="js/jquery.min.js" defer></script>
<script src="js/jazzy.js" defer></script>
</head>
<body>
<a title="Protocols Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="index.html">SwiftValidator Reference</a>
<img id="carat" src="img/carat.png" />
Protocols Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>Protocols</h1>
<p>The following protocols are available globally.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:P14SwiftValidator4Rule"></a>
<a name="//apple_ref/swift/Protocol/Rule" class="dashAnchor"></a>
<a class="token" href="#/s:P14SwiftValidator4Rule">Rule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The <code>Rule</code> protocol declares the required methods for all objects that subscribe to it.</p>
<a href="Protocols/Rule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:P14SwiftValidator18ValidationDelegate"></a>
<a name="//apple_ref/swift/Protocol/ValidationDelegate" class="dashAnchor"></a>
<a class="token" href="#/s:P14SwiftValidator18ValidationDelegate">ValidationDelegate</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Protocol for <code>ValidationDelegate</code> adherents, which comes with two required methods that are called depending on whether validation succeeded or failed.</p>
<a href="Protocols/ValidationDelegate.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">@objc</span> <span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">ValidationDelegate</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

223
docs/Protocols/Rule.html Normal file
View File

@ -0,0 +1,223 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Rule Protocol Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Protocol/Rule" class="dashAnchor"></a>
<a title="Rule Protocol Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
Rule Protocol Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>Rule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
<p>The <code>Rule</code> protocol declares the required methods for all objects that subscribe to it.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FP14SwiftValidator4Rule8validateuRq_S0__Fq_FSSSb"></a>
<a name="//apple_ref/swift/Method/validate(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FP14SwiftValidator4Rule8validateuRq_S0__Fq_FSSSb">validate(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Validates text of a text field.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="nv">value</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>value</em>
</code>
</td>
<td>
<div>
<p>String of text to be validated.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>Boolean value. True if validation is successful; False if validation fails.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FP14SwiftValidator4Rule12errorMessageuRq_S0__Fq_FT_SS"></a>
<a name="//apple_ref/swift/Method/errorMessage()" class="dashAnchor"></a>
<a class="token" href="#/s:FP14SwiftValidator4Rule12errorMessageuRq_S0__Fq_FT_SS">errorMessage()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Displays error message of a text field that has failed validation.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">errorMessage</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">String</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>String of error message.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

View File

@ -0,0 +1,203 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>ValidationDelegate Protocol Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Protocol/ValidationDelegate" class="dashAnchor"></a>
<a title="ValidationDelegate Protocol Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
ValidationDelegate Protocol Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>ValidationDelegate</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">@objc</span> <span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">ValidationDelegate</span></code></pre>
</div>
</div>
<p>Protocol for <code>ValidationDelegate</code> adherents, which comes with two required methods that are called depending on whether validation succeeded or failed.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FP14SwiftValidator18ValidationDelegate20validationSuccessfuluRq_S0__Fq_FT_T_"></a>
<a name="//apple_ref/swift/Method/validationSuccessful()" class="dashAnchor"></a>
<a class="token" href="#/s:FP14SwiftValidator18ValidationDelegate20validationSuccessfuluRq_S0__Fq_FT_T_">validationSuccessful()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>This method will be called on delegate object when validation is successful.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">validationSuccessful</span><span class="p">()</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>No return value.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FP14SwiftValidator18ValidationDelegate16validationFaileduRq_S0__Fq_FGVSs10DictionaryCSo11UITextFieldCS_15ValidationError_T_"></a>
<a name="//apple_ref/swift/Method/validationFailed(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FP14SwiftValidator18ValidationDelegate16validationFaileduRq_S0__Fq_FGVSs10DictionaryCSo11UITextFieldCS_15ValidationError_T_">validationFailed(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>This method will be called on delegate object when validation fails.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">validationFailed</span><span class="p">(</span><span class="nv">errors</span><span class="p">:</span> <span class="p">[</span><span class="kt">UITextField</span><span class="p">:</span><span class="kt">ValidationError</span><span class="p">])</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>No return value.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

200
docs/css/highlight.css Normal file
View File

@ -0,0 +1,200 @@
/* Credit to https://gist.github.com/wataru420/2048287 */
.highlight {
/* Comment */
/* Error */
/* Keyword */
/* Operator */
/* Comment.Multiline */
/* Comment.Preproc */
/* Comment.Single */
/* Comment.Special */
/* Generic.Deleted */
/* Generic.Deleted.Specific */
/* Generic.Emph */
/* Generic.Error */
/* Generic.Heading */
/* Generic.Inserted */
/* Generic.Inserted.Specific */
/* Generic.Output */
/* Generic.Prompt */
/* Generic.Strong */
/* Generic.Subheading */
/* Generic.Traceback */
/* Keyword.Constant */
/* Keyword.Declaration */
/* Keyword.Pseudo */
/* Keyword.Reserved */
/* Keyword.Type */
/* Literal.Number */
/* Literal.String */
/* Name.Attribute */
/* Name.Builtin */
/* Name.Class */
/* Name.Constant */
/* Name.Entity */
/* Name.Exception */
/* Name.Function */
/* Name.Namespace */
/* Name.Tag */
/* Name.Variable */
/* Operator.Word */
/* Text.Whitespace */
/* Literal.Number.Float */
/* Literal.Number.Hex */
/* Literal.Number.Integer */
/* Literal.Number.Oct */
/* Literal.String.Backtick */
/* Literal.String.Char */
/* Literal.String.Doc */
/* Literal.String.Double */
/* Literal.String.Escape */
/* Literal.String.Heredoc */
/* Literal.String.Interpol */
/* Literal.String.Other */
/* Literal.String.Regex */
/* Literal.String.Single */
/* Literal.String.Symbol */
/* Name.Builtin.Pseudo */
/* Name.Variable.Class */
/* Name.Variable.Global */
/* Name.Variable.Instance */
/* Literal.Number.Integer.Long */ }
.highlight .c {
color: #999988;
font-style: italic; }
.highlight .err {
color: #a61717;
background-color: #e3d2d2; }
.highlight .k {
color: #000000;
font-weight: bold; }
.highlight .o {
color: #000000;
font-weight: bold; }
.highlight .cm {
color: #999988;
font-style: italic; }
.highlight .cp {
color: #999999;
font-weight: bold; }
.highlight .c1 {
color: #999988;
font-style: italic; }
.highlight .cs {
color: #999999;
font-weight: bold;
font-style: italic; }
.highlight .gd {
color: #000000;
background-color: #ffdddd; }
.highlight .gd .x {
color: #000000;
background-color: #ffaaaa; }
.highlight .ge {
color: #000000;
font-style: italic; }
.highlight .gr {
color: #aa0000; }
.highlight .gh {
color: #999999; }
.highlight .gi {
color: #000000;
background-color: #ddffdd; }
.highlight .gi .x {
color: #000000;
background-color: #aaffaa; }
.highlight .go {
color: #888888; }
.highlight .gp {
color: #555555; }
.highlight .gs {
font-weight: bold; }
.highlight .gu {
color: #aaaaaa; }
.highlight .gt {
color: #aa0000; }
.highlight .kc {
color: #000000;
font-weight: bold; }
.highlight .kd {
color: #000000;
font-weight: bold; }
.highlight .kp {
color: #000000;
font-weight: bold; }
.highlight .kr {
color: #000000;
font-weight: bold; }
.highlight .kt {
color: #445588; }
.highlight .m {
color: #009999; }
.highlight .s {
color: #d14; }
.highlight .na {
color: #008080; }
.highlight .nb {
color: #0086B3; }
.highlight .nc {
color: #445588;
font-weight: bold; }
.highlight .no {
color: #008080; }
.highlight .ni {
color: #800080; }
.highlight .ne {
color: #990000;
font-weight: bold; }
.highlight .nf {
color: #990000; }
.highlight .nn {
color: #555555; }
.highlight .nt {
color: #000080; }
.highlight .nv {
color: #008080; }
.highlight .ow {
color: #000000;
font-weight: bold; }
.highlight .w {
color: #bbbbbb; }
.highlight .mf {
color: #009999; }
.highlight .mh {
color: #009999; }
.highlight .mi {
color: #009999; }
.highlight .mo {
color: #009999; }
.highlight .sb {
color: #d14; }
.highlight .sc {
color: #d14; }
.highlight .sd {
color: #d14; }
.highlight .s2 {
color: #d14; }
.highlight .se {
color: #d14; }
.highlight .sh {
color: #d14; }
.highlight .si {
color: #d14; }
.highlight .sx {
color: #d14; }
.highlight .sr {
color: #009926; }
.highlight .s1 {
color: #d14; }
.highlight .ss {
color: #990073; }
.highlight .bp {
color: #999999; }
.highlight .vc {
color: #008080; }
.highlight .vg {
color: #008080; }
.highlight .vi {
color: #008080; }
.highlight .il {
color: #009999; }

331
docs/css/jazzy.css Normal file
View File

@ -0,0 +1,331 @@
html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td {
background: transparent;
border: 0;
margin: 0;
outline: 0;
padding: 0;
vertical-align: baseline; }
body {
background-color: #f2f2f2;
font-family: Helvetica, freesans, Arial, sans-serif;
font-size: 14px;
-webkit-font-smoothing: subpixel-antialiased;
word-wrap: break-word; }
h1, h2, h3 {
margin-top: 0.8em;
margin-bottom: 0.3em;
font-weight: 100;
color: black; }
h1 {
font-size: 2.5em; }
h2 {
font-size: 2em;
border-bottom: 1px solid #e2e2e2; }
h4 {
font-size: 13px;
line-height: 1.5;
margin-top: 21px; }
h5 {
font-size: 1.1em; }
h6 {
font-size: 1.1em;
color: #777; }
.section-name {
color: gray;
display: block;
font-family: Helvetica;
font-size: 22px;
font-weight: 100;
margin-bottom: 15px; }
pre, code {
font: 0.95em Menlo, monospace;
color: #777;
word-wrap: normal; }
p code, li code {
background-color: #eee;
padding: 2px 4px;
border-radius: 4px; }
a {
color: #0088cc;
text-decoration: none; }
ul {
padding-left: 15px; }
li {
line-height: 1.8em; }
img {
max-width: 100%; }
blockquote {
margin-left: 0;
padding: 0 10px;
border-left: 4px solid #ccc; }
.content-wrapper {
margin: 0 auto;
width: 980px; }
header {
font-size: 0.85em;
line-height: 26px;
background-color: #414141;
position: fixed;
width: 100%;
z-index: 1; }
header img {
padding-right: 6px;
vertical-align: -4px;
height: 16px; }
header a {
color: #fff; }
header p {
float: left;
color: #999; }
header .header-right {
float: right;
margin-left: 16px; }
#breadcrumbs {
background-color: #f2f2f2;
height: 27px;
padding-top: 17px;
position: fixed;
width: 100%;
z-index: 1;
margin-top: 26px; }
#breadcrumbs #carat {
height: 10px;
margin: 0 5px; }
.sidebar {
background-color: #f9f9f9;
border: 1px solid #e2e2e2;
overflow-y: auto;
overflow-x: hidden;
position: fixed;
top: 70px;
bottom: 0;
width: 230px;
word-wrap: normal; }
.nav-groups {
list-style-type: none;
background: #fff;
padding-left: 0; }
.nav-group-name {
border-bottom: 1px solid #e2e2e2;
font-size: 1.1em;
font-weight: 100;
padding: 15px 0 15px 20px; }
.nav-group-name > a {
color: #333; }
.nav-group-tasks {
margin-top: 5px; }
.nav-group-task {
font-size: 0.9em;
list-style-type: none; }
.nav-group-task a {
color: #888; }
.main-content {
background-color: #fff;
border: 1px solid #e2e2e2;
margin-left: 246px;
position: absolute;
overflow: hidden;
padding-bottom: 60px;
top: 70px;
width: 734px; }
.main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote {
margin-bottom: 1em; }
.main-content p {
line-height: 1.8em; }
.main-content section .section:first-child {
margin-top: 0;
padding-top: 0; }
.main-content section .task-group-section .task-group:first-of-type {
padding-top: 10px; }
.main-content section .task-group-section .task-group:first-of-type .section-name {
padding-top: 15px; }
.section {
padding: 0 25px; }
.highlight {
background-color: #eee;
padding: 10px 12px;
border: 1px solid #e2e2e2;
border-radius: 4px;
overflow-x: auto; }
.declaration .highlight {
overflow-x: initial;
padding: 0 40px 40px 0;
margin-bottom: -25px;
background-color: transparent;
border: none; }
.section-name {
margin: 0;
margin-left: 18px; }
.task-group-section {
padding-left: 6px;
border-top: 1px solid #e2e2e2; }
.task-group {
padding-top: 0px; }
.task-name-container a[name]:before {
content: "";
display: block;
padding-top: 70px;
margin: -70px 0 0; }
.item {
padding-top: 8px;
width: 100%;
list-style-type: none; }
.item a[name]:before {
content: "";
display: block;
padding-top: 70px;
margin: -70px 0 0; }
.item code {
background-color: transparent;
padding: 0; }
.item .token {
padding-left: 3px;
margin-left: 15px;
font-size: 11.9px; }
.item .declaration-note {
font-size: .85em;
color: gray;
font-style: italic; }
.pointer-container {
border-bottom: 1px solid #e2e2e2;
left: -23px;
padding-bottom: 13px;
position: relative;
width: 110%; }
.pointer {
background: #f9f9f9;
border-left: 1px solid #e2e2e2;
border-top: 1px solid #e2e2e2;
height: 12px;
left: 21px;
top: -7px;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
position: absolute;
width: 12px; }
.height-container {
display: none;
left: -25px;
padding: 0 25px;
position: relative;
width: 100%;
overflow: hidden; }
.height-container .section {
background: #f9f9f9;
border-bottom: 1px solid #e2e2e2;
left: -25px;
position: relative;
width: 100%;
padding-top: 10px;
padding-bottom: 5px; }
.aside, .language {
padding: 6px 12px;
margin: 12px 0;
border-left: 5px solid #dddddd;
overflow-y: hidden; }
.aside .aside-title, .language .aside-title {
font-size: 9px;
letter-spacing: 2px;
text-transform: uppercase;
padding-bottom: 0;
margin: 0;
color: #aaa;
-webkit-user-select: none; }
.aside p:last-child, .language p:last-child {
margin-bottom: 0; }
.language {
border-left: 5px solid #cde9f4; }
.language .aside-title {
color: #4b8afb; }
.aside-warning {
border-left: 5px solid #ff6666; }
.aside-warning .aside-title {
color: #ff0000; }
.graybox {
border-collapse: collapse;
width: 100%; }
.graybox p {
margin: 0;
word-break: break-word;
min-width: 50px; }
.graybox td {
border: 1px solid #e2e2e2;
padding: 5px 25px 5px 10px;
vertical-align: middle; }
.graybox tr td:first-of-type {
text-align: right;
padding: 7px;
vertical-align: top;
word-break: normal;
width: 40px; }
.slightly-smaller {
font-size: 0.9em; }
#footer {
position: absolute;
bottom: 10px;
margin-left: 25px; }
#footer p {
margin: 0;
color: #aaa;
font-size: 0.8em; }
html.dash header, html.dash #breadcrumbs, html.dash .sidebar {
display: none; }
html.dash .main-content {
width: 980px;
margin-left: 0;
border: none;
width: 100%;
top: 0;
padding-bottom: 0; }
html.dash .height-container {
display: block; }
html.dash .item .token {
margin-left: 0; }
html.dash .content-wrapper {
width: auto; }
html.dash #footer {
position: static; }

View File

@ -0,0 +1,20 @@
<?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>CFBundleIdentifier</key>
<string>com.jazzy.swiftvalidator</string>
<key>CFBundleName</key>
<string>SwiftValidator</string>
<key>DocSetPlatformFamily</key>
<string>jazzy</string>
<key>isDashDocset</key>
<true/>
<key>dashIndexFilePath</key>
<string>index.html</string>
<key>isJavaScriptEnabled</key>
<true/>
<key>DashDocSetFamily</key>
<string>dashtoc</string>
</dict>
</plist>

View File

@ -0,0 +1,804 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Classes Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset='utf-8'>
<script src="js/jquery.min.js" defer></script>
<script src="js/jazzy.js" defer></script>
</head>
<body>
<a title="Classes Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="index.html">SwiftValidator Reference</a>
<img id="carat" src="img/carat.png" />
Classes Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>Classes</h1>
<p>The following classes are available globally.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator9EmailRule"></a>
<a name="//apple_ref/swift/Class/EmailRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator9EmailRule">EmailRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>EmailRule</code> is a subclass of RegexRule that defines how a email is validated.</p>
<a href="Classes/EmailRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">EmailRule</span><span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator12FullNameRule"></a>
<a name="//apple_ref/swift/Class/FullNameRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator12FullNameRule">FullNameRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>FullNameRule</code> is a subclass of Rule that defines how a full name is validated.</p>
<a href="Classes/FullNameRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">FullNameRule</span> <span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator11ZipCodeRule"></a>
<a name="//apple_ref/swift/Class/ZipCodeRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator11ZipCodeRule">ZipCodeRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>ZipCodeRule</code> is a subclass of <code><a href="Classes/RegexRule.html">RegexRule</a></code> that represents how zip codes are to be validated.</p>
<a href="Classes/ZipCodeRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ZipCodeRule</span><span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator12PasswordRule"></a>
<a name="//apple_ref/swift/Class/PasswordRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator12PasswordRule">PasswordRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>PasswordRule</code> is a subclass of RegexRule that defines how a password is validated.</p>
<a href="Classes/PasswordRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">PasswordRule</span> <span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator16AlphaNumericRule"></a>
<a name="//apple_ref/swift/Class/AlphaNumericRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator16AlphaNumericRule">AlphaNumericRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>AlphaNumericRule</code> is a subclass of <code><a href="Classes/CharacterSetRule.html">CharacterSetRule</a></code>. It is used to verify that a field has a
valid list of alphanumeric characters.</p>
<a href="Classes/AlphaNumericRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">AlphaNumericRule</span><span class="p">:</span> <span class="kt">CharacterSetRule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator16CharacterSetRule"></a>
<a name="//apple_ref/swift/Class/CharacterSetRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator16CharacterSetRule">CharacterSetRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>CharacterSetRule</code> is a subclass of <code><a href="Protocols/Rule.html">Rule</a></code>. It is used to validate IPV4 address fields.</p>
<a href="Classes/CharacterSetRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">CharacterSetRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator15PhoneNumberRule"></a>
<a name="//apple_ref/swift/Class/PhoneNumberRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator15PhoneNumberRule">PhoneNumberRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>PhoneNumberRule</code> is a subclass of Rule that defines how a phone number is validated.</p>
<a href="Classes/PhoneNumberRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">PhoneNumberRule</span><span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator9FloatRule"></a>
<a name="//apple_ref/swift/Class/FloatRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator9FloatRule">FloatRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>FloatRule</code> is a subclass of Rule that defines how check if a value is a floating point value.</p>
<a href="Classes/FloatRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">FloatRule</span><span class="p">:</span><span class="kt">Rule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator12HexColorRule"></a>
<a name="//apple_ref/swift/Class/HexColorRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator12HexColorRule">HexColorRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>HexColorRule</code> is a subclass of <code><a href="Classes/RegexRule.html">RegexRule</a></code>. It is used to verify whether a field is a hexadecimal color.</p>
<a href="Classes/HexColorRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">HexColorRule</span><span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator9Validator"></a>
<a name="//apple_ref/swift/Class/Validator" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator9Validator">Validator</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Class that makes <code>Validator</code> objects. Should be added as a parameter to ViewController that will display
validation fields.</p>
<a href="Classes/Validator.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">Validator</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator14ValidationRule"></a>
<a name="//apple_ref/swift/Class/ValidationRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator14ValidationRule">ValidationRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>ValidationRule</code> is a class that creates an object which holds validation info of a text field.</p>
<a href="Classes/ValidationRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ValidationRule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator16ConfirmationRule"></a>
<a name="//apple_ref/swift/Class/ConfirmationRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator16ConfirmationRule">ConfirmationRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>ConfirmationRule</code> is a subclass of Rule that defines how a text field that has to be equal
to another text field is validated.</p>
<a href="Classes/ConfirmationRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ConfirmationRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator8IPV4Rule"></a>
<a name="//apple_ref/swift/Class/IPV4Rule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator8IPV4Rule">IPV4Rule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>IPV4Rule</code> is a subclass of RegexRule that defines how a IPV4 address validated.</p>
<a href="Classes/IPV4Rule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">IPV4Rule</span><span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator8ISBNRule"></a>
<a name="//apple_ref/swift/Class/ISBNRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator8ISBNRule">ISBNRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>ISBNRule</code> is a subclass of <code><a href="Protocols/Rule.html">Rule</a></code>. It is used to verify whether a field is a valid ISBN number.</p>
<a href="Classes/ISBNRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ISBNRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator15ValidationError"></a>
<a name="//apple_ref/swift/Class/ValidationError" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator15ValidationError">ValidationError</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The <code>ValidationError</code> class is used for representing errors of a failed validation. It contains the text field, error label, and error message of a failed validation.</p>
<a href="Classes/ValidationError.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ValidationError</span><span class="p">:</span> <span class="kt">NSObject</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator12RequiredRule"></a>
<a name="//apple_ref/swift/Class/RequiredRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator12RequiredRule">RequiredRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>RequiredRule</code> is a subclass of Rule that defines how a required text field is validated.</p>
<a href="Classes/RequiredRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">RequiredRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator9RegexRule"></a>
<a name="//apple_ref/swift/Class/RegexRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator9RegexRule">RegexRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>RegexRule</code> is a subclass of Rule that defines how a regular expression is validated.</p>
<a href="Classes/RegexRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">RegexRule</span> <span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator9AlphaRule"></a>
<a name="//apple_ref/swift/Class/AlphaRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator9AlphaRule">AlphaRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>AlphaRule</code> is a subclass of <code><a href="Classes/CharacterSetRule.html">CharacterSetRule</a></code>. It is used to verify that a field has a
valid list of alpha characters.</p>
<a href="Classes/AlphaRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">AlphaRule</span><span class="p">:</span> <span class="kt">CharacterSetRule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator13MinLengthRule"></a>
<a name="//apple_ref/swift/Class/MinLengthRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator13MinLengthRule">MinLengthRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>MinLengthRule</code> is a subclass of Rule that defines how minimum character length is validated.</p>
<a href="Classes/MinLengthRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">MinLengthRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator13MaxLengthRule"></a>
<a name="//apple_ref/swift/Class/MaxLengthRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator13MaxLengthRule">MaxLengthRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>MaxLengthRule</code> is a subclass of <code><a href="Protocols/Rule.html">Rule</a></code> that defines how maximum character length is validated.</p>
<a href="Classes/MaxLengthRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">MaxLengthRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C14SwiftValidator15ExactLengthRule"></a>
<a name="//apple_ref/swift/Class/ExactLengthRule" class="dashAnchor"></a>
<a class="token" href="#/s:C14SwiftValidator15ExactLengthRule">ExactLengthRule</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>ExactLengthRule</code> is a subclass of Rule that is used to make sure a the text of a text field is an exact length.</p>
<a href="Classes/ExactLengthRule.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ExactLengthRule</span> <span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

View File

@ -0,0 +1,192 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>AlphaNumericRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/AlphaNumericRule" class="dashAnchor"></a>
<a title="AlphaNumericRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
AlphaNumericRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>AlphaNumericRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">AlphaNumericRule</span><span class="p">:</span> <span class="kt">CharacterSetRule</span></code></pre>
</div>
</div>
<p><code>AlphaNumericRule</code> is a subclass of <code><a href="../Classes/CharacterSetRule.html">CharacterSetRule</a></code>. It is used to verify that a field has a
valid list of alphanumeric characters.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator16AlphaNumericRulecFMS0_FT7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator16AlphaNumericRulecFMS0_FT7messageSS_S0_">init(message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes a <code><a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a></code> object to verify that field has valid set of alphanumeric characters.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Enter valid numeric characters"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>String of error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

View File

@ -0,0 +1,192 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>AlphaRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/AlphaRule" class="dashAnchor"></a>
<a title="AlphaRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
AlphaRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>AlphaRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">AlphaRule</span><span class="p">:</span> <span class="kt">CharacterSetRule</span></code></pre>
</div>
</div>
<p><code>AlphaRule</code> is a subclass of <code><a href="../Classes/CharacterSetRule.html">CharacterSetRule</a></code>. It is used to verify that a field has a
valid list of alpha characters.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator9AlphaRulecFMS0_FT7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator9AlphaRulecFMS0_FT7messageSS_S0_">init(message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes an <code><a href="../Classes/AlphaRule.html">AlphaRule</a></code> object to verify that a field has valid set of alpha characters.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Enter valid alphabetic characters"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>String of error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized object, or nil if an object could not be created for some reason.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

View File

@ -0,0 +1,288 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>CharacterSetRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/CharacterSetRule" class="dashAnchor"></a>
<a title="CharacterSetRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
CharacterSetRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>CharacterSetRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">CharacterSetRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
<p><code>CharacterSetRule</code> is a subclass of <code><a href="../Protocols/Rule.html">Rule</a></code>. It is used to validate IPV4 address fields.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator16CharacterSetRulecFMS0_FT12characterSetCSo14NSCharacterSet7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(characterSet:message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator16CharacterSetRulecFMS0_FT12characterSetCSo14NSCharacterSet7messageSS_S0_">init(characterSet:message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes a <code><a href="../Classes/CharacterSetRule.html">CharacterSetRule</a></code> object to verify that field has valid set of characters.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">characterSet</span><span class="p">:</span> <span class="kt">NSCharacterSet</span><span class="p">,</span> <span class="nv">message</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Enter valid alpha"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>characterSet</em>
</code>
</td>
<td>
<div>
<p>NSCharacterSet that holds group of valid characters.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>String of error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator16CharacterSetRule8validateFS0_FSSSb"></a>
<a name="//apple_ref/swift/Method/validate(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator16CharacterSetRule8validateFS0_FSSSb">validate(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Used to validate field.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="nv">value</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>value</em>
</code>
</td>
<td>
<div>
<p>String to checked for validation.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>Boolean value. True if validation is successful; False if validation fails.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator16CharacterSetRule12errorMessageFS0_FT_SS"></a>
<a name="//apple_ref/swift/Method/errorMessage()" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator16CharacterSetRule12errorMessageFS0_FT_SS">errorMessage()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Displays error message when text field fails validation.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">errorMessage</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">String</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>String of error message.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

View File

@ -0,0 +1,289 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>ConfirmationRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/ConfirmationRule" class="dashAnchor"></a>
<a title="ConfirmationRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
ConfirmationRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>ConfirmationRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ConfirmationRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
<p><code>ConfirmationRule</code> is a subclass of Rule that defines how a text field that has to be equal
to another text field is validated.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator16ConfirmationRulecFMS0_FT12confirmFieldCSo11UITextField7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(confirmField:message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator16ConfirmationRulecFMS0_FT12confirmFieldCSo11UITextField7messageSS_S0_">init(confirmField:message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes a <code><a href="../Classes/ConfirmationRule.html">ConfirmationRule</a></code> object to validate the text of a text field that should equal the text of another text field.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">confirmField</span><span class="p">:</span> <span class="kt">UITextField</span><span class="p">,</span> <span class="nv">message</span> <span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"This field does not match"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>confirmField</em>
</code>
</td>
<td>
<div>
<p>text field to which original text field will be compared to.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>String of error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator16ConfirmationRule8validateFS0_FSSSb"></a>
<a name="//apple_ref/swift/Method/validate(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator16ConfirmationRule8validateFS0_FSSSb">validate(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Used to validate a text field.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="nv">value</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>value</em>
</code>
</td>
<td>
<div>
<p>String to checked for validation.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>A boolean value. True if validation is successful; False if validation fails.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator16ConfirmationRule12errorMessageFS0_FT_SS"></a>
<a name="//apple_ref/swift/Method/errorMessage()" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator16ConfirmationRule12errorMessageFS0_FT_SS">errorMessage()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Displays an error message when text field fails validation.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">errorMessage</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">String</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>String of error message.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

View File

@ -0,0 +1,191 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>EmailRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/EmailRule" class="dashAnchor"></a>
<a title="EmailRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
EmailRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>EmailRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">EmailRule</span><span class="p">:</span> <span class="kt">RegexRule</span></code></pre>
</div>
</div>
<p><code>EmailRule</code> is a subclass of RegexRule that defines how a email is validated.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator9EmailRulecFMS0_FT7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator9EmailRulecFMS0_FT7messageSS_S0_">init(message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes an <code><a href="../Classes/EmailRule.html">EmailRule</a></code> object to validate an email text field.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="n">convenience</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span> <span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Must be a valid email address"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>String of error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

View File

@ -0,0 +1,288 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>ExactLengthRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/ExactLengthRule" class="dashAnchor"></a>
<a title="ExactLengthRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
ExactLengthRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>ExactLengthRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ExactLengthRule</span> <span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
<p><code>ExactLengthRule</code> is a subclass of Rule that is used to make sure a the text of a text field is an exact length.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator15ExactLengthRulecFMS0_FT6lengthSi7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(length:message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator15ExactLengthRulecFMS0_FT6lengthSi7messageSS_S0_">init(length:message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes an <code><a href="../Classes/ExactLengthRule.html">ExactLengthRule</a></code> object to validate the text of a text field against an exact length.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">length</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">message</span> <span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Must be exactly %ld characters long"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>length</em>
</code>
</td>
<td>
<div>
<p>Integer value of exact string length being specified.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>String of error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized <code><a href="../Classes/ExactLengthRule.html">ExactLengthRule</a></code> object, or nil if an object could not be created for some reason. that would not result in an exception.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator15ExactLengthRule8validateFS0_FSSSb"></a>
<a name="//apple_ref/swift/Method/validate(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator15ExactLengthRule8validateFS0_FSSSb">validate(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Used to validate a text field.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="nv">value</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>value</em>
</code>
</td>
<td>
<div>
<p>String to checked for validation.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>A boolean value. True if validation is successful; False if validation fails.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator15ExactLengthRule12errorMessageFS0_FT_SS"></a>
<a name="//apple_ref/swift/Method/errorMessage()" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator15ExactLengthRule12errorMessageFS0_FT_SS">errorMessage()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Displays error message if a text field fails validation.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">errorMessage</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">String</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>String of error message.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

View File

@ -0,0 +1,275 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>FloatRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/FloatRule" class="dashAnchor"></a>
<a title="FloatRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
FloatRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>FloatRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">FloatRule</span><span class="p">:</span><span class="kt">Rule</span></code></pre>
</div>
</div>
<p><code>FloatRule</code> is a subclass of Rule that defines how check if a value is a floating point value.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator9FloatRulecFMS0_FT7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator9FloatRulecFMS0_FT7messageSS_S0_">init(message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes a <code><a href="../Classes/FloatRule.html">FloatRule</a></code> object to validate that the text of a text field is a floating point number.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span> <span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"This must be a number with or without a decimal"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>String of error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator9FloatRule8validateFS0_FSSSb"></a>
<a name="//apple_ref/swift/Method/validate(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator9FloatRule8validateFS0_FSSSb">validate(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Used to validate text field.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="nv">value</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>value</em>
</code>
</td>
<td>
<div>
<p>String to checked for validation.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>Boolean value. True if validation is successful; False if validation fails.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator9FloatRule12errorMessageFS0_FT_SS"></a>
<a name="//apple_ref/swift/Method/errorMessage()" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator9FloatRule12errorMessageFS0_FT_SS">errorMessage()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Displays error message when text field fails validation.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">errorMessage</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">String</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>String of error message.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

View File

@ -0,0 +1,275 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>FullNameRule Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/FullNameRule" class="dashAnchor"></a>
<a title="FullNameRule Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftValidator Reference</a>
<img id="carat" src="../img/carat.png" />
FullNameRule Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/AlphaRule.html">AlphaRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/EmailRule.html">EmailRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FloatRule.html">FloatRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/FullNameRule.html">FullNameRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/HexColorRule.html">HexColorRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/IPV4Rule.html">IPV4Rule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ISBNRule.html">ISBNRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/MinLengthRule.html">MinLengthRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PasswordRule.html">PasswordRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RegexRule.html">RegexRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/RequiredRule.html">RequiredRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationError.html">ValidationError</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ValidationRule.html">ValidationRule</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Validator.html">Validator</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Rule.html">Rule</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>FullNameRule</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">FullNameRule</span> <span class="p">:</span> <span class="kt">Rule</span></code></pre>
</div>
</div>
<p><code>FullNameRule</code> is a subclass of Rule that defines how a full name is validated.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator12FullNameRulecFMS0_FT7messageSS_S0_"></a>
<a name="//apple_ref/swift/Method/init(message:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator12FullNameRulecFMS0_FT7messageSS_S0_">init(message:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Initializes a <code><a href="../Classes/FullNameRule.html">FullNameRule</a></code> object that is used to verify that text in text field is a full name.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">message</span> <span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Please provide a first &amp; last name"</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>String of error message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>An initialized <code><a href="../Classes/FullNameRule.html">FullNameRule</a></code> object, or nil if an object could not be created for some reason that would not result in an exception.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator12FullNameRule8validateFS0_FSSSb"></a>
<a name="//apple_ref/swift/Method/validate(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator12FullNameRule8validateFS0_FSSSb">validate(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Used to validate a text field.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="nv">value</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>value</em>
</code>
</td>
<td>
<div>
<p>String to checked for validation.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>A boolean value. True if validation is successful; False if validation fails.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC14SwiftValidator12FullNameRule12errorMessageFS0_FT_SS"></a>
<a name="//apple_ref/swift/Method/errorMessage()" class="dashAnchor"></a>
<a class="token" href="#/s:FC14SwiftValidator12FullNameRule12errorMessageFS0_FT_SS">errorMessage()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Used to display error message of a text field that has failed validation.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">errorMessage</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">String</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>String of error message.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

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