diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..86e8dc3
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,33 @@
+# 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
\ No newline at end of file
diff --git a/Swift-Validator.podspec b/Swift-Validator.podspec
index 559473c..09aee9d 100644
--- a/Swift-Validator.podspec
+++ b/Swift-Validator.podspec
@@ -8,6 +8,7 @@ Pod::Spec.new do |s|
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
diff --git a/Validator.xcodeproj/project.xcworkspace/xcshareddata/Validator.xccheckout b/Validator.xcodeproj/project.xcworkspace/xcshareddata/Validator.xccheckout
deleted file mode 100644
index d931fc0..0000000
--- a/Validator.xcodeproj/project.xcworkspace/xcshareddata/Validator.xccheckout
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
- IDESourceControlProjectFavoriteDictionaryKey
-
- IDESourceControlProjectIdentifier
- 41CB4003-1551-4C4C-B53F-78A56D1DFBE5
- IDESourceControlProjectName
- Validator
- IDESourceControlProjectOriginsDictionary
-
- 42B8B6166721AE55A9AFCAC5F4DF5276CF0E0973
- github.com:jpotts18/swift-validator.git
-
- IDESourceControlProjectPath
- Validator.xcodeproj
- IDESourceControlProjectRelativeInstallPathDictionary
-
- 42B8B6166721AE55A9AFCAC5F4DF5276CF0E0973
- ../..
-
- IDESourceControlProjectURL
- github.com:jpotts18/swift-validator.git
- IDESourceControlProjectVersion
- 111
- IDESourceControlProjectWCCIdentifier
- 42B8B6166721AE55A9AFCAC5F4DF5276CF0E0973
- IDESourceControlProjectWCConfigurations
-
-
- IDESourceControlRepositoryExtensionIdentifierKey
- public.vcs.git
- IDESourceControlWCCIdentifierKey
- 42B8B6166721AE55A9AFCAC5F4DF5276CF0E0973
- IDESourceControlWCCName
- Validator
-
-
-
-
diff --git a/Validator.xcodeproj/project.xcworkspace/xcuserdata/jpotts18.xcuserdatad/UserInterfaceState.xcuserstate b/Validator.xcodeproj/project.xcworkspace/xcuserdata/jpotts18.xcuserdatad/UserInterfaceState.xcuserstate
deleted file mode 100644
index e34a8f0..0000000
Binary files a/Validator.xcodeproj/project.xcworkspace/xcuserdata/jpotts18.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ
diff --git a/Validator.xcodeproj/xcuserdata/jpotts18.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Validator.xcodeproj/xcuserdata/jpotts18.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
deleted file mode 100644
index fe2b454..0000000
--- a/Validator.xcodeproj/xcuserdata/jpotts18.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
diff --git a/Validator.xcodeproj/xcuserdata/jpotts18.xcuserdatad/xcschemes/Validator.xcscheme b/Validator.xcodeproj/xcuserdata/jpotts18.xcuserdatad/xcschemes/Validator.xcscheme
deleted file mode 100644
index 3c966ea..0000000
--- a/Validator.xcodeproj/xcuserdata/jpotts18.xcuserdatad/xcschemes/Validator.xcscheme
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Validator.xcodeproj/xcuserdata/jpotts18.xcuserdatad/xcschemes/xcschememanagement.plist b/Validator.xcodeproj/xcuserdata/jpotts18.xcuserdatad/xcschemes/xcschememanagement.plist
deleted file mode 100644
index 0231fc7..0000000
--- a/Validator.xcodeproj/xcuserdata/jpotts18.xcuserdatad/xcschemes/xcschememanagement.plist
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
- SchemeUserState
-
- Validator.xcscheme
-
- orderHint
- 0
-
-
- SuppressBuildableAutocreation
-
- 62D1AE161A1E6D4400E4DFF8
-
- primary
-
-
- 62D1AE2B1A1E6D4500E4DFF8
-
- primary
-
-
-
-
-
diff --git a/Validator/EmailRule.swift b/Validator/EmailRule.swift
index 4203a2a..0fe027b 100644
--- a/Validator/EmailRule.swift
+++ b/Validator/EmailRule.swift
@@ -21,10 +21,9 @@ class EmailRule: Rule {
}
func validate(value: String) -> Bool {
- if let test = NSPredicate(format: "SELF MATCHES %@", self.REGEX) {
- if test.evaluateWithObject(value) {
- return true
- }
+ let test = NSPredicate(format: "SELF MATCHES \(self.REGEX)")
+ if test.evaluateWithObject(value) {
+ return true
}
return false
}
diff --git a/Validator/MinLengthRule.swift b/Validator/MinLengthRule.swift
index 4971000..0c94f4a 100644
--- a/Validator/MinLengthRule.swift
+++ b/Validator/MinLengthRule.swift
@@ -22,7 +22,7 @@ class MinLengthRule : Rule {
}
func validate(value: String) -> Bool {
- if countElements(value) < DEFAULT_MIN_LENGTH {
+ if count(value) < DEFAULT_MIN_LENGTH {
return false
}
return true
diff --git a/Validator/PasswordRule.swift b/Validator/PasswordRule.swift
index 5dbe149..a237660 100644
--- a/Validator/PasswordRule.swift
+++ b/Validator/PasswordRule.swift
@@ -31,10 +31,9 @@ class PasswordRule : Rule {
}
func validate(value: String) -> Bool {
- if let test = NSPredicate(format: "SELF MATCHES %@", self.REGEX) {
- if test.evaluateWithObject(value) {
- return true
- }
+ let test = NSPredicate(format: "SELF MATCHES \(self.REGEX)")
+ if test.evaluateWithObject(value) {
+ return true
}
return false
}
diff --git a/Validator/ZipCodeRule.swift b/Validator/ZipCodeRule.swift
index 4d35c30..672c8e9 100644
--- a/Validator/ZipCodeRule.swift
+++ b/Validator/ZipCodeRule.swift
@@ -19,10 +19,9 @@ class ZipCodeRule: Rule {
}
func validate(value: String) -> Bool {
- if let test = NSPredicate(format: "SELF MATCHES %@", self.REGEX) {
- if test.evaluateWithObject(value) {
- return true
- }
+ let test = NSPredicate(format: "SELF MATCHES \(self.REGEX)")
+ if test.evaluateWithObject(value) {
+ return true
}
return false
}