├── .gitignore ├── .travis.yml ├── Example ├── ExampleApp │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ ├── Main.storyboard │ │ └── object_validator_custom.strings │ ├── Info.plist │ ├── RegistrationValidator.swift │ ├── UserRegistration.swift │ ├── ViewController.swift │ └── it.lproj │ │ └── object_validator_custom.strings ├── FluidValidator.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── FluidValidator.xcworkspace │ └── contents.xcworkspacedata ├── Podfile ├── Podfile.lock ├── Pods │ ├── Local Podspecs │ │ └── FluidValidator.podspec.json │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ └── project.pbxproj │ └── Target Support Files │ │ ├── FluidValidator-iOS8.3 │ │ ├── FluidValidator-iOS8.3-dummy.m │ │ ├── FluidValidator-iOS8.3-prefix.pch │ │ ├── FluidValidator-iOS8.3-umbrella.h │ │ ├── FluidValidator-iOS8.3.modulemap │ │ ├── FluidValidator-iOS8.3.xcconfig │ │ └── Info.plist │ │ ├── FluidValidator-iOS9.3 │ │ ├── FluidValidator-iOS9.3-dummy.m │ │ ├── FluidValidator-iOS9.3-prefix.pch │ │ ├── FluidValidator-iOS9.3-umbrella.h │ │ ├── FluidValidator-iOS9.3.modulemap │ │ ├── FluidValidator-iOS9.3.xcconfig │ │ └── Info.plist │ │ ├── Pods-ExampleApp │ │ ├── Info.plist │ │ ├── Pods-ExampleApp-acknowledgements.markdown │ │ ├── Pods-ExampleApp-acknowledgements.plist │ │ ├── Pods-ExampleApp-dummy.m │ │ ├── Pods-ExampleApp-frameworks.sh │ │ ├── Pods-ExampleApp-resources.sh │ │ ├── Pods-ExampleApp-umbrella.h │ │ ├── Pods-ExampleApp.debug.xcconfig │ │ ├── Pods-ExampleApp.modulemap │ │ └── Pods-ExampleApp.release.xcconfig │ │ └── Pods-FluidValidator_Tests │ │ ├── Info.plist │ │ ├── Pods-FluidValidator_Tests-acknowledgements.markdown │ │ ├── Pods-FluidValidator_Tests-acknowledgements.plist │ │ ├── Pods-FluidValidator_Tests-dummy.m │ │ ├── Pods-FluidValidator_Tests-frameworks.sh │ │ ├── Pods-FluidValidator_Tests-resources.sh │ │ ├── Pods-FluidValidator_Tests-umbrella.h │ │ ├── Pods-FluidValidator_Tests.debug.xcconfig │ │ ├── Pods-FluidValidator_Tests.modulemap │ │ └── Pods-FluidValidator_Tests.release.xcconfig ├── TestPlayground.playground │ ├── Contents.swift │ ├── Resources │ │ └── object_validator_custom.strings │ └── contents.xcplayground └── Tests │ ├── ContainerObject.swift │ ├── ContainerValidator.swift │ ├── Example.swift │ ├── ExampleValidator.swift │ ├── ExampleValidator2.swift │ ├── FluidValidatorTests.swift │ ├── Info.plist │ ├── ListContainer.swift │ ├── ListContainerValidator.swift │ ├── ValidationTests.swift │ └── ValidatorsTests.swift ├── FluidValidator.podspec ├── Framework ├── FluidValidator │ ├── FluidValidator.h │ └── Info.plist └── Framework.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ └── xcschemes │ └── FluidValidator.xcscheme ├── LICENSE ├── Pod ├── Classes │ ├── .gitkeep │ ├── Core │ │ ├── AbstractValidationRule.swift │ │ ├── AbstractValidator.swift │ │ ├── EnumeratorValidator.swift │ │ ├── ErrorMessage.swift │ │ ├── FailMessage.swift │ │ ├── LocalizationHelper.swift │ │ ├── Validatable.swift │ │ ├── Validation.swift │ │ └── ValidationBase.swift │ └── Validators │ │ ├── BeNotEmpty.swift │ │ ├── BeNotNil.swift │ │ ├── BeTrue.swift │ │ ├── GenericRule.swift │ │ ├── GreaterThan.swift │ │ ├── InRange.swift │ │ ├── LessThan.swift │ │ ├── RegexMatch.swift │ │ └── ValidEmail.swift └── FluidValidator.bundle │ ├── .gitkeep │ ├── en.lproj │ └── object_validator.strings │ └── it.lproj │ └── object_validator.strings ├── README.md ├── _FluidValidatorFramework.xcodeproj └── _Pods.xcodeproj /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | Carthage 26 | # We recommend against adding the Pods directory to your .gitignore. However 27 | # you should judge for yourself, the pros and cons are mentioned at: 28 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 29 | # 30 | # Note: if you ignore the Pods directory, make sure to uncomment 31 | # `pod install` in .travis.yml 32 | # 33 | # Pods/ 34 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * http://www.objc.io/issue-6/travis-ci.html 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | language: objective-c 6 | # cache: cocoapods 7 | # podfile: Example/Podfile 8 | # before_install: 9 | # - gem install cocoapods # Since Travis is not always on latest version 10 | # - pod install --project-directory=Example 11 | script: 12 | - set -o pipefail && xcodebuild test -workspace Example/FluidValidator.xcworkspace -scheme FluidValidator-Example -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty 13 | - pod lib lint 14 | -------------------------------------------------------------------------------- /Example/ExampleApp/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // ExampleApp 4 | // 5 | // Created by Antonio Di Giacomo on 26/04/16. 6 | // Copyright © 2016 CocoaPods. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // 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. 24 | // 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. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // 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. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // 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. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // 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. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Example/ExampleApp/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /Example/ExampleApp/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Example/ExampleApp/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /Example/ExampleApp/Base.lproj/object_validator_custom.strings: -------------------------------------------------------------------------------- 1 | /* 2 | object_validator_custom.strings 3 | FluidValidator 4 | 5 | Created by Antonio Di Giacomo on 27/04/16. 6 | Copyright © 2016 CocoaPods. All rights reserved. 7 | */ 8 | "UserRegistration.email.error.name" = "Email"; 9 | "UserRegistration.firstname.error.name" = "Lastname"; 10 | "UserRegistration.lastname.error.name" = "Fistname"; -------------------------------------------------------------------------------- /Example/ExampleApp/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Example/ExampleApp/RegistrationValidator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RegistrationValidator.swift 3 | // FluidValidator 4 | // 5 | // Created by Antonio Di Giacomo on 26/04/16. 6 | // Copyright © 2016 CocoaPods. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import FluidValidator 11 | 12 | class RegistrationValidator:AbstractValidator { 13 | internal override init() { 14 | super.init() 15 | 16 | self.addValidation(withName: "firstname") { (context) -> (AnyObject?) in 17 | context.firstname as AnyObject? 18 | }.addRule(BeNotEmpty()) 19 | 20 | self.addValidation(withName: "lastname") { (context) -> (AnyObject?) in 21 | context.lastname as AnyObject? 22 | }.addRule(BeNotEmpty()) 23 | 24 | self.addValidation(withName: "email") { (context) -> (AnyObject?) in 25 | context.email as AnyObject? 26 | }.addRule(ValidEmail()) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Example/ExampleApp/UserRegistration.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UserRegistration.swift 3 | // FluidValidator 4 | // 5 | // Created by Antonio Di Giacomo on 26/04/16. 6 | // Copyright © 2016 CocoaPods. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | open class UserRegistration { 12 | var firstname:String? 13 | var lastname:String? 14 | var email:String? 15 | } 16 | -------------------------------------------------------------------------------- /Example/ExampleApp/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // ExampleApp 4 | // 5 | // Created by Antonio Di Giacomo on 26/04/16. 6 | // Copyright © 2016 CocoaPods. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import FluidValidator 11 | 12 | class ViewController: UIViewController { 13 | 14 | fileprivate var validator:RegistrationValidator = RegistrationValidator() 15 | fileprivate var registration:UserRegistration = UserRegistration() 16 | 17 | @IBOutlet weak var firstname: UITextField! 18 | @IBOutlet weak var lastname: UITextField! 19 | @IBOutlet weak var email: UITextField! 20 | 21 | override func viewDidLoad() { 22 | super.viewDidLoad() 23 | } 24 | 25 | override func didReceiveMemoryWarning() { 26 | super.didReceiveMemoryWarning() 27 | // Dispose of any resources that can be recreated. 28 | } 29 | 30 | @IBAction func resetPressed(_ sender: AnyObject) { 31 | 32 | } 33 | 34 | @IBAction func savePressed(_ sender: AnyObject) { 35 | self.registration.firstname = self.firstname.text 36 | self.registration.lastname = self.lastname.text 37 | self.registration.email = self.email.text 38 | 39 | let _ = self.validator.validate(object: self.registration) 40 | 41 | let error = validator.allErrors 42 | let alert = UIAlertController() 43 | let actionOk = UIAlertAction(title: "ok", style: .default) { (action) in 44 | alert.dismiss(animated: true, completion: nil) 45 | } 46 | alert.title = "info" 47 | alert.addAction(actionOk) 48 | 49 | if error.failingFields().count > 0 { 50 | let errMessages = error.failingFields().map({ (fieldname) -> String in 51 | error.failMessageForPath(fieldname)!.errors.first!.extended 52 | }).joined(separator: "\n") 53 | alert.message = errMessages 54 | }else{ 55 | alert.message = "Congrats! Validation passed!" 56 | } 57 | 58 | self.present(alert, animated: true, completion: nil) 59 | } 60 | } 61 | 62 | -------------------------------------------------------------------------------- /Example/ExampleApp/it.lproj/object_validator_custom.strings: -------------------------------------------------------------------------------- 1 | /* 2 | object_validator_custom.strings 3 | FluidValidator 4 | 5 | Created by Antonio Di Giacomo on 27/04/16. 6 | Copyright © 2016 CocoaPods. All rights reserved. 7 | */ 8 | "UserRegistration.email.error.name" = "E-mail"; 9 | "UserRegistration.firstname.error.name" = "Nome"; 10 | "UserRegistration.lastname.error.name" = "Cognome"; -------------------------------------------------------------------------------- /Example/FluidValidator.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 161E7C211C66146C00E43C0A /* ValidationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 161E7C201C66146C00E43C0A /* ValidationTests.swift */; }; 11 | 161E7C231C6614DB00E43C0A /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 161E7C221C6614DA00E43C0A /* Example.swift */; }; 12 | 163216BF1C6649B6002444F1 /* ValidatorsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 163216BE1C6649B6002444F1 /* ValidatorsTests.swift */; }; 13 | 163216C31C667D69002444F1 /* FluidValidatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 163216C21C667D69002444F1 /* FluidValidatorTests.swift */; }; 14 | 163216C51C667ED5002444F1 /* ExampleValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 163216C41C667ED5002444F1 /* ExampleValidator.swift */; }; 15 | 163216CB1C66BD10002444F1 /* ContainerObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 163216CA1C66BD10002444F1 /* ContainerObject.swift */; }; 16 | 163216CD1C66BDCD002444F1 /* ContainerValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 163216CC1C66BDCD002444F1 /* ContainerValidator.swift */; }; 17 | 163216D11C675344002444F1 /* ListContainerValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 163216D01C675344002444F1 /* ListContainerValidator.swift */; }; 18 | 163216D31C67539A002444F1 /* ListContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 163216D21C67539A002444F1 /* ListContainer.swift */; }; 19 | 1652CDE71CD0166B0003E602 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1652CDE61CD0166B0003E602 /* AppDelegate.swift */; }; 20 | 1652CDE91CD0166B0003E602 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1652CDE81CD0166B0003E602 /* ViewController.swift */; }; 21 | 1652CDEC1CD0166B0003E602 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1652CDEA1CD0166B0003E602 /* Main.storyboard */; }; 22 | 1652CDEE1CD0166B0003E602 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1652CDED1CD0166B0003E602 /* Assets.xcassets */; }; 23 | 1652CDF11CD0166B0003E602 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1652CDEF1CD0166B0003E602 /* LaunchScreen.storyboard */; }; 24 | 1652CDF71CD017320003E602 /* UserRegistration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1652CDF61CD017320003E602 /* UserRegistration.swift */; }; 25 | 1652CDF91CD019D10003E602 /* RegistrationValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1652CDF81CD019D10003E602 /* RegistrationValidator.swift */; }; 26 | 1652CDFC1CD026450003E602 /* object_validator_custom.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1652CDFE1CD026450003E602 /* object_validator_custom.strings */; }; 27 | 16D6E9BF1D232D8A00B76F9A /* ExampleValidator2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16D6E9BE1D232D8A00B76F9A /* ExampleValidator2.swift */; }; 28 | 18D95B64DC844CEA0D54E7D4 /* Pods_FluidValidator_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0B361B70F1E9D191ACD2220C /* Pods_FluidValidator_Tests.framework */; }; 29 | D23202CE36868ACCC47F5C70 /* Pods_ExampleApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 645E0006AAF9006F1886584F /* Pods_ExampleApp.framework */; }; 30 | /* End PBXBuildFile section */ 31 | 32 | /* Begin PBXContainerItemProxy section */ 33 | 16EE4A8D1D908D57000E54EB /* PBXContainerItemProxy */ = { 34 | isa = PBXContainerItemProxy; 35 | containerPortal = 607FACC81AFB9204008FA782 /* Project object */; 36 | proxyType = 1; 37 | remoteGlobalIDString = 1652CDE31CD0166B0003E602; 38 | remoteInfo = ExampleApp; 39 | }; 40 | /* End PBXContainerItemProxy section */ 41 | 42 | /* Begin PBXFileReference section */ 43 | 0B361B70F1E9D191ACD2220C /* Pods_FluidValidator_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_FluidValidator_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 160CFFE41E5E3ADA00AA3835 /* TestPlayground.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = TestPlayground.playground; sourceTree = ""; }; 45 | 161E7C201C66146C00E43C0A /* ValidationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValidationTests.swift; sourceTree = ""; }; 46 | 161E7C221C6614DA00E43C0A /* Example.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; }; 47 | 163216BE1C6649B6002444F1 /* ValidatorsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValidatorsTests.swift; sourceTree = ""; }; 48 | 163216C21C667D69002444F1 /* FluidValidatorTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FluidValidatorTests.swift; sourceTree = ""; }; 49 | 163216C41C667ED5002444F1 /* ExampleValidator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExampleValidator.swift; sourceTree = ""; }; 50 | 163216CA1C66BD10002444F1 /* ContainerObject.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContainerObject.swift; sourceTree = ""; }; 51 | 163216CC1C66BDCD002444F1 /* ContainerValidator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContainerValidator.swift; sourceTree = ""; }; 52 | 163216D01C675344002444F1 /* ListContainerValidator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListContainerValidator.swift; sourceTree = ""; }; 53 | 163216D21C67539A002444F1 /* ListContainer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListContainer.swift; sourceTree = ""; }; 54 | 1652CDE41CD0166B0003E602 /* ExampleApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ExampleApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | 1652CDE61CD0166B0003E602 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 56 | 1652CDE81CD0166B0003E602 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 57 | 1652CDEB1CD0166B0003E602 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 58 | 1652CDED1CD0166B0003E602 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 59 | 1652CDF01CD0166B0003E602 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 60 | 1652CDF21CD0166B0003E602 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 61 | 1652CDF61CD017320003E602 /* UserRegistration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserRegistration.swift; sourceTree = ""; }; 62 | 1652CDF81CD019D10003E602 /* RegistrationValidator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RegistrationValidator.swift; sourceTree = ""; }; 63 | 1652CDFD1CD026450003E602 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/object_validator_custom.strings; sourceTree = ""; }; 64 | 1652CDFF1CD0266C0003E602 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/object_validator_custom.strings; sourceTree = ""; }; 65 | 16D6E9BE1D232D8A00B76F9A /* ExampleValidator2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExampleValidator2.swift; sourceTree = ""; }; 66 | 607FACE51AFB9204008FA782 /* FluidValidator_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FluidValidator_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 67 | 607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 68 | 645E0006AAF9006F1886584F /* Pods_ExampleApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ExampleApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 69 | 812ED0095C9BB354B3CBCF06 /* FluidValidator.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = FluidValidator.podspec; path = ../FluidValidator.podspec; sourceTree = ""; }; 70 | 87D7D4CD02303443127A703F /* Pods-ExampleApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ExampleApp.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ExampleApp/Pods-ExampleApp.debug.xcconfig"; sourceTree = ""; }; 71 | 9AB3AE452F4285FED7BC269F /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 72 | 9AD114C54396BED0E9053145 /* Pods-ExampleApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ExampleApp.release.xcconfig"; path = "Pods/Target Support Files/Pods-ExampleApp/Pods-ExampleApp.release.xcconfig"; sourceTree = ""; }; 73 | 9D7C8E6166F1D2B7B438F3E9 /* Pods-FluidValidator_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FluidValidator_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-FluidValidator_Tests/Pods-FluidValidator_Tests.release.xcconfig"; sourceTree = ""; }; 74 | C781E2049A31A77734C58F9C /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 75 | D2118C8EF4606FC2DBAEDBCF /* Pods-FluidValidator_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FluidValidator_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-FluidValidator_Tests/Pods-FluidValidator_Tests.debug.xcconfig"; sourceTree = ""; }; 76 | /* End PBXFileReference section */ 77 | 78 | /* Begin PBXFrameworksBuildPhase section */ 79 | 1652CDE11CD0166B0003E602 /* Frameworks */ = { 80 | isa = PBXFrameworksBuildPhase; 81 | buildActionMask = 2147483647; 82 | files = ( 83 | D23202CE36868ACCC47F5C70 /* Pods_ExampleApp.framework in Frameworks */, 84 | ); 85 | runOnlyForDeploymentPostprocessing = 0; 86 | }; 87 | 607FACE21AFB9204008FA782 /* Frameworks */ = { 88 | isa = PBXFrameworksBuildPhase; 89 | buildActionMask = 2147483647; 90 | files = ( 91 | 18D95B64DC844CEA0D54E7D4 /* Pods_FluidValidator_Tests.framework in Frameworks */, 92 | ); 93 | runOnlyForDeploymentPostprocessing = 0; 94 | }; 95 | /* End PBXFrameworksBuildPhase section */ 96 | 97 | /* Begin PBXGroup section */ 98 | 1652CDE51CD0166B0003E602 /* ExampleApp */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 1652CDF81CD019D10003E602 /* RegistrationValidator.swift */, 102 | 1652CDF61CD017320003E602 /* UserRegistration.swift */, 103 | 1652CDE61CD0166B0003E602 /* AppDelegate.swift */, 104 | 1652CDE81CD0166B0003E602 /* ViewController.swift */, 105 | 1652CDEA1CD0166B0003E602 /* Main.storyboard */, 106 | 1652CDED1CD0166B0003E602 /* Assets.xcassets */, 107 | 1652CDEF1CD0166B0003E602 /* LaunchScreen.storyboard */, 108 | 1652CDF21CD0166B0003E602 /* Info.plist */, 109 | 1652CDFE1CD026450003E602 /* object_validator_custom.strings */, 110 | ); 111 | path = ExampleApp; 112 | sourceTree = ""; 113 | }; 114 | 607FACC71AFB9204008FA782 = { 115 | isa = PBXGroup; 116 | children = ( 117 | 160CFFE41E5E3ADA00AA3835 /* TestPlayground.playground */, 118 | 607FACF51AFB993E008FA782 /* Podspec Metadata */, 119 | 607FACE81AFB9204008FA782 /* Tests */, 120 | 1652CDE51CD0166B0003E602 /* ExampleApp */, 121 | 607FACD11AFB9204008FA782 /* Products */, 122 | BC5ADF7503E685AA719D3C24 /* Pods */, 123 | E3BCD3E45A0F5DE18E1F74B1 /* Frameworks */, 124 | ); 125 | sourceTree = ""; 126 | }; 127 | 607FACD11AFB9204008FA782 /* Products */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | 607FACE51AFB9204008FA782 /* FluidValidator_Tests.xctest */, 131 | 1652CDE41CD0166B0003E602 /* ExampleApp.app */, 132 | ); 133 | name = Products; 134 | sourceTree = ""; 135 | }; 136 | 607FACE81AFB9204008FA782 /* Tests */ = { 137 | isa = PBXGroup; 138 | children = ( 139 | 163216C21C667D69002444F1 /* FluidValidatorTests.swift */, 140 | 163216BE1C6649B6002444F1 /* ValidatorsTests.swift */, 141 | 161E7C221C6614DA00E43C0A /* Example.swift */, 142 | 161E7C201C66146C00E43C0A /* ValidationTests.swift */, 143 | 607FACE91AFB9204008FA782 /* Supporting Files */, 144 | 163216C41C667ED5002444F1 /* ExampleValidator.swift */, 145 | 163216CA1C66BD10002444F1 /* ContainerObject.swift */, 146 | 163216CC1C66BDCD002444F1 /* ContainerValidator.swift */, 147 | 163216D01C675344002444F1 /* ListContainerValidator.swift */, 148 | 163216D21C67539A002444F1 /* ListContainer.swift */, 149 | 16D6E9BE1D232D8A00B76F9A /* ExampleValidator2.swift */, 150 | ); 151 | path = Tests; 152 | sourceTree = ""; 153 | }; 154 | 607FACE91AFB9204008FA782 /* Supporting Files */ = { 155 | isa = PBXGroup; 156 | children = ( 157 | 607FACEA1AFB9204008FA782 /* Info.plist */, 158 | ); 159 | name = "Supporting Files"; 160 | sourceTree = ""; 161 | }; 162 | 607FACF51AFB993E008FA782 /* Podspec Metadata */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | 812ED0095C9BB354B3CBCF06 /* FluidValidator.podspec */, 166 | 9AB3AE452F4285FED7BC269F /* README.md */, 167 | C781E2049A31A77734C58F9C /* LICENSE */, 168 | ); 169 | name = "Podspec Metadata"; 170 | sourceTree = ""; 171 | }; 172 | BC5ADF7503E685AA719D3C24 /* Pods */ = { 173 | isa = PBXGroup; 174 | children = ( 175 | 87D7D4CD02303443127A703F /* Pods-ExampleApp.debug.xcconfig */, 176 | 9AD114C54396BED0E9053145 /* Pods-ExampleApp.release.xcconfig */, 177 | D2118C8EF4606FC2DBAEDBCF /* Pods-FluidValidator_Tests.debug.xcconfig */, 178 | 9D7C8E6166F1D2B7B438F3E9 /* Pods-FluidValidator_Tests.release.xcconfig */, 179 | ); 180 | name = Pods; 181 | sourceTree = ""; 182 | }; 183 | E3BCD3E45A0F5DE18E1F74B1 /* Frameworks */ = { 184 | isa = PBXGroup; 185 | children = ( 186 | 645E0006AAF9006F1886584F /* Pods_ExampleApp.framework */, 187 | 0B361B70F1E9D191ACD2220C /* Pods_FluidValidator_Tests.framework */, 188 | ); 189 | name = Frameworks; 190 | sourceTree = ""; 191 | }; 192 | /* End PBXGroup section */ 193 | 194 | /* Begin PBXNativeTarget section */ 195 | 1652CDE31CD0166B0003E602 /* ExampleApp */ = { 196 | isa = PBXNativeTarget; 197 | buildConfigurationList = 1652CDF51CD0166B0003E602 /* Build configuration list for PBXNativeTarget "ExampleApp" */; 198 | buildPhases = ( 199 | AABCA6943B2F5B299D3DCADB /* [CP] Check Pods Manifest.lock */, 200 | 1652CDE01CD0166B0003E602 /* Sources */, 201 | 1652CDE11CD0166B0003E602 /* Frameworks */, 202 | 1652CDE21CD0166B0003E602 /* Resources */, 203 | 0734891E1DA7258DFEDE4A35 /* [CP] Embed Pods Frameworks */, 204 | CD8658B7A8628A3DADD7A731 /* [CP] Copy Pods Resources */, 205 | ); 206 | buildRules = ( 207 | ); 208 | dependencies = ( 209 | ); 210 | name = ExampleApp; 211 | productName = ExampleApp; 212 | productReference = 1652CDE41CD0166B0003E602 /* ExampleApp.app */; 213 | productType = "com.apple.product-type.application"; 214 | }; 215 | 607FACE41AFB9204008FA782 /* FluidValidator_Tests */ = { 216 | isa = PBXNativeTarget; 217 | buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "FluidValidator_Tests" */; 218 | buildPhases = ( 219 | 83CD6608B83DD2CCB2FF1EB2 /* [CP] Check Pods Manifest.lock */, 220 | 607FACE11AFB9204008FA782 /* Sources */, 221 | 607FACE21AFB9204008FA782 /* Frameworks */, 222 | 607FACE31AFB9204008FA782 /* Resources */, 223 | D70019106BBECC9A113BA0CA /* [CP] Embed Pods Frameworks */, 224 | EE4CBBD24321E45A6B855D2E /* [CP] Copy Pods Resources */, 225 | ); 226 | buildRules = ( 227 | ); 228 | dependencies = ( 229 | 16EE4A8E1D908D57000E54EB /* PBXTargetDependency */, 230 | ); 231 | name = FluidValidator_Tests; 232 | productName = Tests; 233 | productReference = 607FACE51AFB9204008FA782 /* FluidValidator_Tests.xctest */; 234 | productType = "com.apple.product-type.bundle.unit-test"; 235 | }; 236 | /* End PBXNativeTarget section */ 237 | 238 | /* Begin PBXProject section */ 239 | 607FACC81AFB9204008FA782 /* Project object */ = { 240 | isa = PBXProject; 241 | attributes = { 242 | LastSwiftUpdateCheck = 0730; 243 | LastUpgradeCheck = 0820; 244 | ORGANIZATIONNAME = CocoaPods; 245 | TargetAttributes = { 246 | 1652CDE31CD0166B0003E602 = { 247 | CreatedOnToolsVersion = 7.3; 248 | DevelopmentTeam = 7ANT8E5L74; 249 | LastSwiftMigration = 0800; 250 | }; 251 | 607FACE41AFB9204008FA782 = { 252 | CreatedOnToolsVersion = 6.3.1; 253 | LastSwiftMigration = 0800; 254 | TestTargetID = 1652CDE31CD0166B0003E602; 255 | }; 256 | }; 257 | }; 258 | buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "FluidValidator" */; 259 | compatibilityVersion = "Xcode 3.2"; 260 | developmentRegion = English; 261 | hasScannedForEncodings = 0; 262 | knownRegions = ( 263 | en, 264 | Base, 265 | it, 266 | ); 267 | mainGroup = 607FACC71AFB9204008FA782; 268 | productRefGroup = 607FACD11AFB9204008FA782 /* Products */; 269 | projectDirPath = ""; 270 | projectRoot = ""; 271 | targets = ( 272 | 607FACE41AFB9204008FA782 /* FluidValidator_Tests */, 273 | 1652CDE31CD0166B0003E602 /* ExampleApp */, 274 | ); 275 | }; 276 | /* End PBXProject section */ 277 | 278 | /* Begin PBXResourcesBuildPhase section */ 279 | 1652CDE21CD0166B0003E602 /* Resources */ = { 280 | isa = PBXResourcesBuildPhase; 281 | buildActionMask = 2147483647; 282 | files = ( 283 | 1652CDF11CD0166B0003E602 /* LaunchScreen.storyboard in Resources */, 284 | 1652CDFC1CD026450003E602 /* object_validator_custom.strings in Resources */, 285 | 1652CDEE1CD0166B0003E602 /* Assets.xcassets in Resources */, 286 | 1652CDEC1CD0166B0003E602 /* Main.storyboard in Resources */, 287 | ); 288 | runOnlyForDeploymentPostprocessing = 0; 289 | }; 290 | 607FACE31AFB9204008FA782 /* Resources */ = { 291 | isa = PBXResourcesBuildPhase; 292 | buildActionMask = 2147483647; 293 | files = ( 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | }; 297 | /* End PBXResourcesBuildPhase section */ 298 | 299 | /* Begin PBXShellScriptBuildPhase section */ 300 | 0734891E1DA7258DFEDE4A35 /* [CP] Embed Pods Frameworks */ = { 301 | isa = PBXShellScriptBuildPhase; 302 | buildActionMask = 2147483647; 303 | files = ( 304 | ); 305 | inputPaths = ( 306 | ); 307 | name = "[CP] Embed Pods Frameworks"; 308 | outputPaths = ( 309 | ); 310 | runOnlyForDeploymentPostprocessing = 0; 311 | shellPath = /bin/sh; 312 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ExampleApp/Pods-ExampleApp-frameworks.sh\"\n"; 313 | showEnvVarsInLog = 0; 314 | }; 315 | 83CD6608B83DD2CCB2FF1EB2 /* [CP] Check Pods Manifest.lock */ = { 316 | isa = PBXShellScriptBuildPhase; 317 | buildActionMask = 2147483647; 318 | files = ( 319 | ); 320 | inputPaths = ( 321 | ); 322 | name = "[CP] Check Pods Manifest.lock"; 323 | outputPaths = ( 324 | ); 325 | runOnlyForDeploymentPostprocessing = 0; 326 | shellPath = /bin/sh; 327 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; 328 | showEnvVarsInLog = 0; 329 | }; 330 | AABCA6943B2F5B299D3DCADB /* [CP] Check Pods Manifest.lock */ = { 331 | isa = PBXShellScriptBuildPhase; 332 | buildActionMask = 2147483647; 333 | files = ( 334 | ); 335 | inputPaths = ( 336 | ); 337 | name = "[CP] Check Pods Manifest.lock"; 338 | outputPaths = ( 339 | ); 340 | runOnlyForDeploymentPostprocessing = 0; 341 | shellPath = /bin/sh; 342 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; 343 | showEnvVarsInLog = 0; 344 | }; 345 | CD8658B7A8628A3DADD7A731 /* [CP] Copy Pods Resources */ = { 346 | isa = PBXShellScriptBuildPhase; 347 | buildActionMask = 2147483647; 348 | files = ( 349 | ); 350 | inputPaths = ( 351 | ); 352 | name = "[CP] Copy Pods Resources"; 353 | outputPaths = ( 354 | ); 355 | runOnlyForDeploymentPostprocessing = 0; 356 | shellPath = /bin/sh; 357 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ExampleApp/Pods-ExampleApp-resources.sh\"\n"; 358 | showEnvVarsInLog = 0; 359 | }; 360 | D70019106BBECC9A113BA0CA /* [CP] Embed Pods Frameworks */ = { 361 | isa = PBXShellScriptBuildPhase; 362 | buildActionMask = 2147483647; 363 | files = ( 364 | ); 365 | inputPaths = ( 366 | ); 367 | name = "[CP] Embed Pods Frameworks"; 368 | outputPaths = ( 369 | ); 370 | runOnlyForDeploymentPostprocessing = 0; 371 | shellPath = /bin/sh; 372 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-FluidValidator_Tests/Pods-FluidValidator_Tests-frameworks.sh\"\n"; 373 | showEnvVarsInLog = 0; 374 | }; 375 | EE4CBBD24321E45A6B855D2E /* [CP] Copy Pods Resources */ = { 376 | isa = PBXShellScriptBuildPhase; 377 | buildActionMask = 2147483647; 378 | files = ( 379 | ); 380 | inputPaths = ( 381 | ); 382 | name = "[CP] Copy Pods Resources"; 383 | outputPaths = ( 384 | ); 385 | runOnlyForDeploymentPostprocessing = 0; 386 | shellPath = /bin/sh; 387 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-FluidValidator_Tests/Pods-FluidValidator_Tests-resources.sh\"\n"; 388 | showEnvVarsInLog = 0; 389 | }; 390 | /* End PBXShellScriptBuildPhase section */ 391 | 392 | /* Begin PBXSourcesBuildPhase section */ 393 | 1652CDE01CD0166B0003E602 /* Sources */ = { 394 | isa = PBXSourcesBuildPhase; 395 | buildActionMask = 2147483647; 396 | files = ( 397 | 1652CDF71CD017320003E602 /* UserRegistration.swift in Sources */, 398 | 1652CDE91CD0166B0003E602 /* ViewController.swift in Sources */, 399 | 1652CDE71CD0166B0003E602 /* AppDelegate.swift in Sources */, 400 | 1652CDF91CD019D10003E602 /* RegistrationValidator.swift in Sources */, 401 | ); 402 | runOnlyForDeploymentPostprocessing = 0; 403 | }; 404 | 607FACE11AFB9204008FA782 /* Sources */ = { 405 | isa = PBXSourcesBuildPhase; 406 | buildActionMask = 2147483647; 407 | files = ( 408 | 161E7C211C66146C00E43C0A /* ValidationTests.swift in Sources */, 409 | 163216C31C667D69002444F1 /* FluidValidatorTests.swift in Sources */, 410 | 163216CB1C66BD10002444F1 /* ContainerObject.swift in Sources */, 411 | 163216CD1C66BDCD002444F1 /* ContainerValidator.swift in Sources */, 412 | 163216D11C675344002444F1 /* ListContainerValidator.swift in Sources */, 413 | 163216D31C67539A002444F1 /* ListContainer.swift in Sources */, 414 | 16D6E9BF1D232D8A00B76F9A /* ExampleValidator2.swift in Sources */, 415 | 163216BF1C6649B6002444F1 /* ValidatorsTests.swift in Sources */, 416 | 161E7C231C6614DB00E43C0A /* Example.swift in Sources */, 417 | 163216C51C667ED5002444F1 /* ExampleValidator.swift in Sources */, 418 | ); 419 | runOnlyForDeploymentPostprocessing = 0; 420 | }; 421 | /* End PBXSourcesBuildPhase section */ 422 | 423 | /* Begin PBXTargetDependency section */ 424 | 16EE4A8E1D908D57000E54EB /* PBXTargetDependency */ = { 425 | isa = PBXTargetDependency; 426 | target = 1652CDE31CD0166B0003E602 /* ExampleApp */; 427 | targetProxy = 16EE4A8D1D908D57000E54EB /* PBXContainerItemProxy */; 428 | }; 429 | /* End PBXTargetDependency section */ 430 | 431 | /* Begin PBXVariantGroup section */ 432 | 1652CDEA1CD0166B0003E602 /* Main.storyboard */ = { 433 | isa = PBXVariantGroup; 434 | children = ( 435 | 1652CDEB1CD0166B0003E602 /* Base */, 436 | ); 437 | name = Main.storyboard; 438 | sourceTree = ""; 439 | }; 440 | 1652CDEF1CD0166B0003E602 /* LaunchScreen.storyboard */ = { 441 | isa = PBXVariantGroup; 442 | children = ( 443 | 1652CDF01CD0166B0003E602 /* Base */, 444 | ); 445 | name = LaunchScreen.storyboard; 446 | sourceTree = ""; 447 | }; 448 | 1652CDFE1CD026450003E602 /* object_validator_custom.strings */ = { 449 | isa = PBXVariantGroup; 450 | children = ( 451 | 1652CDFD1CD026450003E602 /* Base */, 452 | 1652CDFF1CD0266C0003E602 /* it */, 453 | ); 454 | name = object_validator_custom.strings; 455 | sourceTree = ""; 456 | }; 457 | /* End PBXVariantGroup section */ 458 | 459 | /* Begin XCBuildConfiguration section */ 460 | 1652CDF31CD0166B0003E602 /* Debug */ = { 461 | isa = XCBuildConfiguration; 462 | baseConfigurationReference = 87D7D4CD02303443127A703F /* Pods-ExampleApp.debug.xcconfig */; 463 | buildSettings = { 464 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 465 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 466 | CLANG_ANALYZER_NONNULL = YES; 467 | DEBUG_INFORMATION_FORMAT = dwarf; 468 | INFOPLIST_FILE = ExampleApp/Info.plist; 469 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 470 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 471 | PRODUCT_BUNDLE_IDENTIFIER = com.frograin.ExampleApp; 472 | PRODUCT_NAME = "$(TARGET_NAME)"; 473 | SWIFT_VERSION = 3.0; 474 | TARGETED_DEVICE_FAMILY = "1,2"; 475 | }; 476 | name = Debug; 477 | }; 478 | 1652CDF41CD0166B0003E602 /* Release */ = { 479 | isa = XCBuildConfiguration; 480 | baseConfigurationReference = 9AD114C54396BED0E9053145 /* Pods-ExampleApp.release.xcconfig */; 481 | buildSettings = { 482 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 483 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 484 | CLANG_ANALYZER_NONNULL = YES; 485 | INFOPLIST_FILE = ExampleApp/Info.plist; 486 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 487 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 488 | PRODUCT_BUNDLE_IDENTIFIER = com.frograin.ExampleApp; 489 | PRODUCT_NAME = "$(TARGET_NAME)"; 490 | SWIFT_VERSION = 3.0; 491 | TARGETED_DEVICE_FAMILY = "1,2"; 492 | }; 493 | name = Release; 494 | }; 495 | 607FACED1AFB9204008FA782 /* Debug */ = { 496 | isa = XCBuildConfiguration; 497 | buildSettings = { 498 | ALWAYS_SEARCH_USER_PATHS = NO; 499 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 500 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 501 | CLANG_CXX_LIBRARY = "libc++"; 502 | CLANG_ENABLE_MODULES = YES; 503 | CLANG_ENABLE_OBJC_ARC = YES; 504 | CLANG_WARN_BOOL_CONVERSION = YES; 505 | CLANG_WARN_CONSTANT_CONVERSION = YES; 506 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 507 | CLANG_WARN_EMPTY_BODY = YES; 508 | CLANG_WARN_ENUM_CONVERSION = YES; 509 | CLANG_WARN_INFINITE_RECURSION = YES; 510 | CLANG_WARN_INT_CONVERSION = YES; 511 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 512 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 513 | CLANG_WARN_UNREACHABLE_CODE = YES; 514 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 515 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 516 | COPY_PHASE_STRIP = NO; 517 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 518 | ENABLE_STRICT_OBJC_MSGSEND = YES; 519 | ENABLE_TESTABILITY = YES; 520 | GCC_C_LANGUAGE_STANDARD = gnu99; 521 | GCC_DYNAMIC_NO_PIC = NO; 522 | GCC_NO_COMMON_BLOCKS = YES; 523 | GCC_OPTIMIZATION_LEVEL = 0; 524 | GCC_PREPROCESSOR_DEFINITIONS = ( 525 | "DEBUG=1", 526 | "$(inherited)", 527 | ); 528 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 529 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 530 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 531 | GCC_WARN_UNDECLARED_SELECTOR = YES; 532 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 533 | GCC_WARN_UNUSED_FUNCTION = YES; 534 | GCC_WARN_UNUSED_VARIABLE = YES; 535 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 536 | MTL_ENABLE_DEBUG_INFO = YES; 537 | ONLY_ACTIVE_ARCH = YES; 538 | SDKROOT = iphoneos; 539 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 540 | }; 541 | name = Debug; 542 | }; 543 | 607FACEE1AFB9204008FA782 /* Release */ = { 544 | isa = XCBuildConfiguration; 545 | buildSettings = { 546 | ALWAYS_SEARCH_USER_PATHS = NO; 547 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 548 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 549 | CLANG_CXX_LIBRARY = "libc++"; 550 | CLANG_ENABLE_MODULES = YES; 551 | CLANG_ENABLE_OBJC_ARC = YES; 552 | CLANG_WARN_BOOL_CONVERSION = YES; 553 | CLANG_WARN_CONSTANT_CONVERSION = YES; 554 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 555 | CLANG_WARN_EMPTY_BODY = YES; 556 | CLANG_WARN_ENUM_CONVERSION = YES; 557 | CLANG_WARN_INFINITE_RECURSION = YES; 558 | CLANG_WARN_INT_CONVERSION = YES; 559 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 560 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 561 | CLANG_WARN_UNREACHABLE_CODE = YES; 562 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 563 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 564 | COPY_PHASE_STRIP = NO; 565 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 566 | ENABLE_NS_ASSERTIONS = NO; 567 | ENABLE_STRICT_OBJC_MSGSEND = YES; 568 | GCC_C_LANGUAGE_STANDARD = gnu99; 569 | GCC_NO_COMMON_BLOCKS = YES; 570 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 571 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 572 | GCC_WARN_UNDECLARED_SELECTOR = YES; 573 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 574 | GCC_WARN_UNUSED_FUNCTION = YES; 575 | GCC_WARN_UNUSED_VARIABLE = YES; 576 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 577 | MTL_ENABLE_DEBUG_INFO = NO; 578 | SDKROOT = iphoneos; 579 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 580 | VALIDATE_PRODUCT = YES; 581 | }; 582 | name = Release; 583 | }; 584 | 607FACF31AFB9204008FA782 /* Debug */ = { 585 | isa = XCBuildConfiguration; 586 | baseConfigurationReference = D2118C8EF4606FC2DBAEDBCF /* Pods-FluidValidator_Tests.debug.xcconfig */; 587 | buildSettings = { 588 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 589 | FRAMEWORK_SEARCH_PATHS = ( 590 | "$(SDKROOT)/Developer/Library/Frameworks", 591 | "$(inherited)", 592 | ); 593 | GCC_PREPROCESSOR_DEFINITIONS = ( 594 | "DEBUG=1", 595 | "$(inherited)", 596 | ); 597 | INFOPLIST_FILE = Tests/Info.plist; 598 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 599 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 600 | PRODUCT_NAME = "$(TARGET_NAME)"; 601 | SWIFT_VERSION = 3.0; 602 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ExampleApp.app/ExampleApp"; 603 | }; 604 | name = Debug; 605 | }; 606 | 607FACF41AFB9204008FA782 /* Release */ = { 607 | isa = XCBuildConfiguration; 608 | baseConfigurationReference = 9D7C8E6166F1D2B7B438F3E9 /* Pods-FluidValidator_Tests.release.xcconfig */; 609 | buildSettings = { 610 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 611 | FRAMEWORK_SEARCH_PATHS = ( 612 | "$(SDKROOT)/Developer/Library/Frameworks", 613 | "$(inherited)", 614 | ); 615 | INFOPLIST_FILE = Tests/Info.plist; 616 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 617 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 618 | PRODUCT_NAME = "$(TARGET_NAME)"; 619 | SWIFT_VERSION = 3.0; 620 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ExampleApp.app/ExampleApp"; 621 | }; 622 | name = Release; 623 | }; 624 | /* End XCBuildConfiguration section */ 625 | 626 | /* Begin XCConfigurationList section */ 627 | 1652CDF51CD0166B0003E602 /* Build configuration list for PBXNativeTarget "ExampleApp" */ = { 628 | isa = XCConfigurationList; 629 | buildConfigurations = ( 630 | 1652CDF31CD0166B0003E602 /* Debug */, 631 | 1652CDF41CD0166B0003E602 /* Release */, 632 | ); 633 | defaultConfigurationIsVisible = 0; 634 | defaultConfigurationName = Release; 635 | }; 636 | 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "FluidValidator" */ = { 637 | isa = XCConfigurationList; 638 | buildConfigurations = ( 639 | 607FACED1AFB9204008FA782 /* Debug */, 640 | 607FACEE1AFB9204008FA782 /* Release */, 641 | ); 642 | defaultConfigurationIsVisible = 0; 643 | defaultConfigurationName = Release; 644 | }; 645 | 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "FluidValidator_Tests" */ = { 646 | isa = XCConfigurationList; 647 | buildConfigurations = ( 648 | 607FACF31AFB9204008FA782 /* Debug */, 649 | 607FACF41AFB9204008FA782 /* Release */, 650 | ); 651 | defaultConfigurationIsVisible = 0; 652 | defaultConfigurationName = Release; 653 | }; 654 | /* End XCConfigurationList section */ 655 | }; 656 | rootObject = 607FACC81AFB9204008FA782 /* Project object */; 657 | } 658 | -------------------------------------------------------------------------------- /Example/FluidValidator.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/FluidValidator.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | use_frameworks! 3 | 4 | target 'FluidValidator_Tests' do 5 | pod 'FluidValidator', :path => '../' 6 | end 7 | 8 | target 'ExampleApp' do 9 | pod 'FluidValidator', :path => '../' 10 | end 11 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - FluidValidator (0.1.2) 3 | 4 | DEPENDENCIES: 5 | - FluidValidator (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | FluidValidator: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | FluidValidator: 25bf6d8543b384b19933a072a2624643567f33c7 13 | 14 | PODFILE CHECKSUM: ccd0c37e6f190789df7bcf3966c6f7fdba253301 15 | 16 | COCOAPODS: 1.1.1 17 | -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/FluidValidator.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "FluidValidator", 3 | "version": "0.1.2", 4 | "summary": "General purpose object validator", 5 | "description": "FluidValidator is intended to encapsulate validation logic. The API was designed with FluentValidation (https://github.com/JeremySkinner/FluentValidation) and Rails Validation as reference.\nCurrently offers validation of simple objects, complex objects (object graph), enumerables. Localized error messages. You can easly override base behaviors and/or build your own reusable validation rules.", 6 | "homepage": "https://github.com/frograin/FluidValidator", 7 | "license": "MIT", 8 | "authors": { 9 | "FrogRain": "info@frograin.com" 10 | }, 11 | "source": { 12 | "git": "https://github.com/frograin/FluidValidator.git", 13 | "tag": "0.1.2" 14 | }, 15 | "platforms": { 16 | "ios": "8.0" 17 | }, 18 | "requires_arc": true, 19 | "source_files": "Pod/Classes/**/*", 20 | "resources": "Pod/FluidValidator.bundle" 21 | } 22 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - FluidValidator (0.1.2) 3 | 4 | DEPENDENCIES: 5 | - FluidValidator (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | FluidValidator: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | FluidValidator: 25bf6d8543b384b19933a072a2624643567f33c7 13 | 14 | PODFILE CHECKSUM: ccd0c37e6f190789df7bcf3966c6f7fdba253301 15 | 16 | COCOAPODS: 1.1.1 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/FluidValidator-iOS8.3/FluidValidator-iOS8.3-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_FluidValidator_iOS8_3 : NSObject 3 | @end 4 | @implementation PodsDummy_FluidValidator_iOS8_3 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/FluidValidator-iOS8.3/FluidValidator-iOS8.3-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/FluidValidator-iOS8.3/FluidValidator-iOS8.3-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | 6 | FOUNDATION_EXPORT double FluidValidatorVersionNumber; 7 | FOUNDATION_EXPORT const unsigned char FluidValidatorVersionString[]; 8 | 9 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/FluidValidator-iOS8.3/FluidValidator-iOS8.3.modulemap: -------------------------------------------------------------------------------- 1 | framework module FluidValidator { 2 | umbrella header "FluidValidator-iOS8.3-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/FluidValidator-iOS8.3/FluidValidator-iOS8.3.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/FluidValidator-iOS8.3 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/FluidValidator-iOS8.3/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.1.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/FluidValidator-iOS9.3/FluidValidator-iOS9.3-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_FluidValidator_iOS9_3 : NSObject 3 | @end 4 | @implementation PodsDummy_FluidValidator_iOS9_3 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/FluidValidator-iOS9.3/FluidValidator-iOS9.3-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/FluidValidator-iOS9.3/FluidValidator-iOS9.3-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | 6 | FOUNDATION_EXPORT double FluidValidatorVersionNumber; 7 | FOUNDATION_EXPORT const unsigned char FluidValidatorVersionString[]; 8 | 9 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/FluidValidator-iOS9.3/FluidValidator-iOS9.3.modulemap: -------------------------------------------------------------------------------- 1 | framework module FluidValidator { 2 | umbrella header "FluidValidator-iOS9.3-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/FluidValidator-iOS9.3/FluidValidator-iOS9.3.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/FluidValidator-iOS9.3 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/FluidValidator-iOS9.3/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.1.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-ExampleApp/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-ExampleApp/Pods-ExampleApp-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## FluidValidator 5 | 6 | Copyright (c) 2016 FrogRain 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - https://cocoapods.org 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-ExampleApp/Pods-ExampleApp-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2016 FrogRain <info@frograin.com> 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | FluidValidator 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - https://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-ExampleApp/Pods-ExampleApp-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_ExampleApp : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_ExampleApp 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-ExampleApp/Pods-ExampleApp-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | 86 | if [[ "$CONFIGURATION" == "Debug" ]]; then 87 | install_framework "$BUILT_PRODUCTS_DIR/FluidValidator-iOS9.3/FluidValidator.framework" 88 | fi 89 | if [[ "$CONFIGURATION" == "Release" ]]; then 90 | install_framework "$BUILT_PRODUCTS_DIR/FluidValidator-iOS9.3/FluidValidator.framework" 91 | fi 92 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-ExampleApp/Pods-ExampleApp-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | case "${TARGETED_DEVICE_FAMILY}" in 12 | 1,2) 13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 14 | ;; 15 | 1) 16 | TARGET_DEVICE_ARGS="--target-device iphone" 17 | ;; 18 | 2) 19 | TARGET_DEVICE_ARGS="--target-device ipad" 20 | ;; 21 | *) 22 | TARGET_DEVICE_ARGS="--target-device mac" 23 | ;; 24 | esac 25 | 26 | install_resource() 27 | { 28 | if [[ "$1" = /* ]] ; then 29 | RESOURCE_PATH="$1" 30 | else 31 | RESOURCE_PATH="${PODS_ROOT}/$1" 32 | fi 33 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 34 | cat << EOM 35 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 36 | EOM 37 | exit 1 38 | fi 39 | case $RESOURCE_PATH in 40 | *.storyboard) 41 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 42 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 43 | ;; 44 | *.xib) 45 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 46 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 47 | ;; 48 | *.framework) 49 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 50 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 51 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 52 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 53 | ;; 54 | *.xcdatamodel) 55 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" 56 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 57 | ;; 58 | *.xcdatamodeld) 59 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" 60 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 61 | ;; 62 | *.xcmappingmodel) 63 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" 64 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 65 | ;; 66 | *.xcassets) 67 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 68 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 69 | ;; 70 | *) 71 | echo "$RESOURCE_PATH" 72 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 73 | ;; 74 | esac 75 | } 76 | 77 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 78 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 79 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 80 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 81 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 82 | fi 83 | rm -f "$RESOURCES_TO_COPY" 84 | 85 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 86 | then 87 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 88 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 89 | while read line; do 90 | if [[ $line != "${PODS_ROOT}*" ]]; then 91 | XCASSET_FILES+=("$line") 92 | fi 93 | done <<<"$OTHER_XCASSETS" 94 | 95 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 96 | fi 97 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-ExampleApp/Pods-ExampleApp-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | 6 | FOUNDATION_EXPORT double Pods_ExampleAppVersionNumber; 7 | FOUNDATION_EXPORT const unsigned char Pods_ExampleAppVersionString[]; 8 | 9 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-ExampleApp/Pods-ExampleApp.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/FluidValidator-iOS9.3" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/FluidValidator-iOS9.3/FluidValidator.framework/Headers" 7 | OTHER_LDFLAGS = $(inherited) -framework "FluidValidator" 8 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 9 | PODS_BUILD_DIR = $BUILD_DIR 10 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-ExampleApp/Pods-ExampleApp.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_ExampleApp { 2 | umbrella header "Pods-ExampleApp-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-ExampleApp/Pods-ExampleApp.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/FluidValidator-iOS9.3" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/FluidValidator-iOS9.3/FluidValidator.framework/Headers" 7 | OTHER_LDFLAGS = $(inherited) -framework "FluidValidator" 8 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 9 | PODS_BUILD_DIR = $BUILD_DIR 10 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-FluidValidator_Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-FluidValidator_Tests/Pods-FluidValidator_Tests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## FluidValidator 5 | 6 | Copyright (c) 2016 FrogRain 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - https://cocoapods.org 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-FluidValidator_Tests/Pods-FluidValidator_Tests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2016 FrogRain <info@frograin.com> 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | FluidValidator 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - https://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-FluidValidator_Tests/Pods-FluidValidator_Tests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_FluidValidator_Tests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_FluidValidator_Tests 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-FluidValidator_Tests/Pods-FluidValidator_Tests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | 86 | if [[ "$CONFIGURATION" == "Debug" ]]; then 87 | install_framework "$BUILT_PRODUCTS_DIR/FluidValidator-iOS8.3/FluidValidator.framework" 88 | fi 89 | if [[ "$CONFIGURATION" == "Release" ]]; then 90 | install_framework "$BUILT_PRODUCTS_DIR/FluidValidator-iOS8.3/FluidValidator.framework" 91 | fi 92 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-FluidValidator_Tests/Pods-FluidValidator_Tests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | case "${TARGETED_DEVICE_FAMILY}" in 12 | 1,2) 13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 14 | ;; 15 | 1) 16 | TARGET_DEVICE_ARGS="--target-device iphone" 17 | ;; 18 | 2) 19 | TARGET_DEVICE_ARGS="--target-device ipad" 20 | ;; 21 | *) 22 | TARGET_DEVICE_ARGS="--target-device mac" 23 | ;; 24 | esac 25 | 26 | install_resource() 27 | { 28 | if [[ "$1" = /* ]] ; then 29 | RESOURCE_PATH="$1" 30 | else 31 | RESOURCE_PATH="${PODS_ROOT}/$1" 32 | fi 33 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 34 | cat << EOM 35 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 36 | EOM 37 | exit 1 38 | fi 39 | case $RESOURCE_PATH in 40 | *.storyboard) 41 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 42 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 43 | ;; 44 | *.xib) 45 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 46 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 47 | ;; 48 | *.framework) 49 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 50 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 51 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 52 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 53 | ;; 54 | *.xcdatamodel) 55 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" 56 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 57 | ;; 58 | *.xcdatamodeld) 59 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" 60 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 61 | ;; 62 | *.xcmappingmodel) 63 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" 64 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 65 | ;; 66 | *.xcassets) 67 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 68 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 69 | ;; 70 | *) 71 | echo "$RESOURCE_PATH" 72 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 73 | ;; 74 | esac 75 | } 76 | 77 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 78 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 79 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 80 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 81 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 82 | fi 83 | rm -f "$RESOURCES_TO_COPY" 84 | 85 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 86 | then 87 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 88 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 89 | while read line; do 90 | if [[ $line != "${PODS_ROOT}*" ]]; then 91 | XCASSET_FILES+=("$line") 92 | fi 93 | done <<<"$OTHER_XCASSETS" 94 | 95 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 96 | fi 97 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-FluidValidator_Tests/Pods-FluidValidator_Tests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | 6 | FOUNDATION_EXPORT double Pods_FluidValidator_TestsVersionNumber; 7 | FOUNDATION_EXPORT const unsigned char Pods_FluidValidator_TestsVersionString[]; 8 | 9 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-FluidValidator_Tests/Pods-FluidValidator_Tests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/FluidValidator-iOS8.3" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/FluidValidator-iOS8.3/FluidValidator.framework/Headers" 7 | OTHER_LDFLAGS = $(inherited) -framework "FluidValidator" 8 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 9 | PODS_BUILD_DIR = $BUILD_DIR 10 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-FluidValidator_Tests/Pods-FluidValidator_Tests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_FluidValidator_Tests { 2 | umbrella header "Pods-FluidValidator_Tests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-FluidValidator_Tests/Pods-FluidValidator_Tests.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/FluidValidator-iOS8.3" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/FluidValidator-iOS8.3/FluidValidator.framework/Headers" 7 | OTHER_LDFLAGS = $(inherited) -framework "FluidValidator" 8 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 9 | PODS_BUILD_DIR = $BUILD_DIR 10 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Example/TestPlayground.playground/Contents.swift: -------------------------------------------------------------------------------- 1 | //: Playground - noun: a place where people can play 2 | 3 | import UIKit 4 | import FluidValidator 5 | 6 | class Home { 7 | var isLocked:Bool? 8 | var number:Int? 9 | var ownerName:String? 10 | var garage: Garage? 11 | var floors: Array? 12 | } 13 | 14 | class Garage { 15 | var isOpen: Bool? 16 | var maxCars: Int? 17 | } 18 | 19 | class Floor { 20 | var rooms: Int 21 | 22 | init(withMaxRooms maxRooms: Int) { 23 | rooms = maxRooms 24 | } 25 | } 26 | 27 | 28 | class HomeValidator : AbstractValidator { 29 | override init() { 30 | super.init() 31 | 32 | self.addValidation(withName: "number") { (context) -> (Any?) in 33 | context.number 34 | }.addRule(GreaterThan(limit: 3, includeLimit: false)) 35 | 36 | self.addValidation(withName: "ownerName") { (context) -> (Any?) in 37 | context.ownerName 38 | }.addRule(BeNotEmpty()) 39 | 40 | self.addValidation(withName: "isLocked") { (context) -> (Any?) in 41 | context.isLocked 42 | }.addRule(BeTrue()) 43 | 44 | self.addValidation(withName: "garage") { (context) -> (Any?) in 45 | context.garage 46 | }.addRule(GarageValidator()) 47 | 48 | self.addValidation(withName: "floors") { (context) -> (Any?) in 49 | context.floors 50 | }.addRule(EnumeratorValidator(validatable: FloorValidator())) 51 | } 52 | } 53 | 54 | class GarageValidator: AbstractValidator { 55 | override init() { 56 | super.init() 57 | 58 | self.addValidation(withName: "isOpen") { (context) -> Any? in 59 | context.isOpen 60 | }.addRule(BeTrue()) 61 | 62 | self.addValidation(withName: "maxCars") { (context) -> Any? in 63 | context.maxCars 64 | }.addRule(LessThan(limit: 2, includeLimit: true)) 65 | } 66 | } 67 | 68 | class FloorValidator: AbstractValidator { 69 | override init() { 70 | super.init() 71 | 72 | self.addValidation(withName: "rooms") { (context) -> Any? in 73 | context.rooms 74 | }.addRule(GreaterThan(limit: 4, includeLimit: true)) 75 | } 76 | } 77 | 78 | let garage = Garage() 79 | garage.isOpen = false 80 | 81 | let floor_1 = Floor(withMaxRooms: 2) 82 | let floor_2 = Floor(withMaxRooms: 3) 83 | 84 | let home = Home() 85 | home.isLocked = true 86 | home.ownerName = "John Doe" 87 | home.number = 2 88 | home.garage = garage 89 | home.floors = [floor_1, floor_2] 90 | 91 | let homeValidator = HomeValidator() 92 | let result = homeValidator.validate(object: home) 93 | let failMessage = homeValidator.allErrors 94 | 95 | failMessage.failMessageForPath("number")?.errors.first?.compact 96 | failMessage.failMessageForPath("number")?.errors.first?.extended 97 | 98 | failMessage.failMessageForPath("garage")?.errors.first?.compact 99 | failMessage.failMessageForPath("garage.isOpen")?.errors.first?.extended 100 | 101 | failMessage.failMessageForPath("floors")?.errors.first?.compact 102 | failMessage.failMessageForPath("floors.0.rooms")?.errors.first?.extended 103 | 104 | -------------------------------------------------------------------------------- /Example/TestPlayground.playground/Resources/object_validator_custom.strings: -------------------------------------------------------------------------------- 1 | /* 2 | object_validator_custom.strings 3 | FluidValidator 4 | 5 | Created by Antonio Di Giacomo on 27/04/16. 6 | Copyright © 2016 CocoaPods. All rights reserved. 7 | */ 8 | "Home.number.error.name" = "Number"; 9 | 10 | "GreaterThan.error.message" = "Hey man, this must be greater."; 11 | "GreaterThan.error.message.extended" = "%1$@ must be greater than %2$@. You supplied %3$@."; 12 | -------------------------------------------------------------------------------- /Example/TestPlayground.playground/contents.xcplayground: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Example/Tests/ContainerObject.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContainerObject.swift 3 | // FluidValidator 4 | // 5 | // Created by FrogRain on 07/02/16. 6 | // Copyright © 2016 CocoaPods. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class ContainerObject { 12 | var example:Example? 13 | var test:String? 14 | } -------------------------------------------------------------------------------- /Example/Tests/ContainerValidator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContainerValidator.swift 3 | // FluidValidator 4 | // 5 | // Created by FrogRain on 07/02/16. 6 | // Copyright © 2016 CocoaPods. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import FluidValidator 11 | 12 | class ContainerValidator : AbstractValidator { 13 | override init() { 14 | super.init() 15 | self.addValidation(withName: "test") { (context) -> (Any?) in 16 | context.test 17 | }.addRule(BeNotEmpty()) 18 | 19 | self.addValidation(withName: "example") { (context) -> (Any?) in 20 | context.example 21 | }.addRule(ExampleValidator()) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Example/Tests/Example.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Example.swift 3 | // TestValidator 4 | // 5 | // Created by FrogRain on 05/02/16. 6 | // Copyright © 2016 FrogRain. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class Example { 12 | var isTrue:Bool? 13 | var number:Int? 14 | var testProperty:String? 15 | var altProperty:String? 16 | } 17 | -------------------------------------------------------------------------------- /Example/Tests/ExampleValidator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleValidator.swift 3 | // FluidValidator 4 | // 5 | // Created by FrogRain on 06/02/16. 6 | // Copyright © 2016 CocoaPods. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import FluidValidator 11 | 12 | class ExampleValidator : AbstractValidator { 13 | override init() { 14 | super.init() 15 | 16 | self.addValidation(withName: "testProperty") { (context) -> (Any?) in 17 | context.testProperty 18 | }.addRule(BeNotNil()) 19 | 20 | self.addValidation(withName: "altProperty") { (context) -> (Any?) in 21 | context.altProperty 22 | }.addRule(BeNotEmpty()) 23 | 24 | self.addValidation(withName: "isTrue") { (context) -> (Any?) in 25 | context.isTrue 26 | }.addRule(BeTrue()) 27 | 28 | self.addValidation(withName: "number") { (context) -> (Any?) in 29 | context.number 30 | }.addRule(LessThan(limit: 3, includeLimit: false)) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Example/Tests/ExampleValidator2.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleValidator2.swift 3 | // FluidValidator 4 | // 5 | // Created by Antonio Di Giacomo on 28/06/16. 6 | // Copyright © 2016 CocoaPods. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import FluidValidator 11 | 12 | class ExampleValidator2: AbstractValidator { 13 | override init() { 14 | super.init() 15 | 16 | let rule1 = InRange(min: 2, max: 8, mode: ComparisonMode.MinMaxExluded) 17 | 18 | let rule2 = InRange(min: 4, max: 6, mode: ComparisonMode.MinMaxExluded) 19 | 20 | let rule3 = InRange(min: 0, max: 10, mode: ComparisonMode.MinMaxExluded) 21 | 22 | self.addValidation(withName: "number") { (context) -> (Any?) in 23 | context.number 24 | } 25 | .addRule(rule1) 26 | .addRule(rule2) 27 | .addRule(rule3) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Example/Tests/FluidValidatorTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FluidValidatorTests.swift 3 | // FluidValidator 4 | // 5 | // Created by FrogRain on 06/02/16. 6 | // Copyright © 2016 CocoaPods. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | fileprivate func < (lhs: T?, rhs: T?) -> Bool { 11 | switch (lhs, rhs) { 12 | case let (l?, r?): 13 | return l < r 14 | case (nil, _?): 15 | return true 16 | default: 17 | return false 18 | } 19 | } 20 | 21 | fileprivate func > (lhs: T?, rhs: T?) -> Bool { 22 | switch (lhs, rhs) { 23 | case let (l?, r?): 24 | return l > r 25 | default: 26 | return rhs < lhs 27 | } 28 | } 29 | 30 | 31 | class FluidValidatorTests: XCTestCase { 32 | 33 | override func setUp() { 34 | super.setUp() 35 | // Put setup code here. This method is called before the invocation of each test method in the class. 36 | } 37 | 38 | override func tearDown() { 39 | // Put teardown code here. This method is called after the invocation of each test method in the class. 40 | super.tearDown() 41 | } 42 | 43 | func testSimpleObject() { 44 | let example = Example() 45 | example.testProperty = nil 46 | example.altProperty = "" 47 | example.number = 3 48 | example.isTrue = false 49 | 50 | let validator = ExampleValidator() 51 | let result = validator.validate(object: example) 52 | let failMessage = validator.allErrors 53 | 54 | XCTAssertFalse(result) 55 | XCTAssertTrue(failMessage.failingFields().count > 0) 56 | } 57 | 58 | func testNestedObject() { 59 | let example = Example() 60 | example.testProperty = nil 61 | example.altProperty = "" 62 | example.number = 3 63 | example.isTrue = false 64 | 65 | let container = ContainerObject() 66 | container.test = "" 67 | container.example = example 68 | 69 | let validator = ContainerValidator() 70 | let result = validator.validate(object: container) 71 | let failMessage = validator.allErrors 72 | 73 | XCTAssertFalse(result) 74 | XCTAssertTrue(failMessage.failMessageForPath("test")?.errors.count > 0) 75 | XCTAssertTrue(failMessage.failMessageForPath("example")?.errors.count > 0) 76 | XCTAssertTrue(failMessage.failMessageForPath("example.number")?.errors.count > 0) 77 | } 78 | 79 | func testValidatableOnEnumerable() { 80 | let example = Example() 81 | example.testProperty = nil 82 | example.altProperty = "" 83 | example.number = 3 84 | example.isTrue = false 85 | 86 | let container = ListContainer() 87 | container.string = "" 88 | container.arrExample = [example, example, example] 89 | 90 | let validator = ListContainerValidator() 91 | let result = validator.validate(object: container) 92 | let failMessage = validator.allErrors 93 | 94 | XCTAssertFalse(result) 95 | XCTAssertTrue(failMessage.failMessageForPath("arrExample.0.number")!.errors.count > 0) 96 | XCTAssertTrue(failMessage.failMessageForPath("arrExample.1.number")!.errors.count > 0) 97 | } 98 | 99 | func testMultipleRulesOnSameProperty() { 100 | let example = Example() 101 | example.number = 5 102 | let validator = ExampleValidator2() 103 | let result = validator.validate(object: example) 104 | let _ = validator.allErrors 105 | XCTAssertTrue(result) 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /Example/Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/Tests/ListContainer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ListContainer.swift 3 | // FluidValidator 4 | // 5 | // Created by FrogRain on 07/02/16. 6 | // Copyright © 2016 CocoaPods. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class ListContainer { 12 | var string:String? 13 | var arrExample:Array? 14 | } -------------------------------------------------------------------------------- /Example/Tests/ListContainerValidator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EnumerableNested.swift 3 | // FluidValidator 4 | // 5 | // Created by FrogRain on 07/02/16. 6 | // Copyright © 2016 CocoaPods. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import FluidValidator 11 | 12 | class ListContainerValidator : AbstractValidator { 13 | override init() { 14 | super.init() 15 | 16 | self.addValidation(withName: "string") { (context) -> (Any?) in 17 | context.string 18 | }.addRule(BeNotEmpty()) 19 | 20 | self.addValidation(withName: "arrExample") { (context) -> (Any?) in 21 | context.arrExample 22 | }.addRule(EnumeratorValidator(validatable: ExampleValidator())) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Example/Tests/ValidationTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TestValidatorTests.swift 3 | // TestValidatorTests 4 | // 5 | // Created by FrogRain on 05/02/16. 6 | // Copyright © 2016 FrogRain. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | import FluidValidator 11 | 12 | class ValidationTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testValidation() { 25 | let validation = Validation(name: "isTrue") { (context:Example) -> (Any?) in 26 | return context.isTrue 27 | } 28 | let rule = BeNotNil() 29 | validation.addRule(rule) 30 | 31 | let example = Example() 32 | 33 | let result = validation.runValidation(example) 34 | 35 | let failMessage = validation.allErrors 36 | 37 | XCTAssertFalse(result) 38 | XCTAssertTrue(failMessage.errors.count > 0) 39 | } 40 | 41 | func testConditionalValidation() { 42 | let validation = Validation(name: "test") { (context:Example) -> (Any?) in 43 | return context.testProperty 44 | } 45 | 46 | validation.when { (context) -> (Bool) in 47 | return context.number == 0 48 | } 49 | 50 | validation.addRule(BeNotEmpty()) 51 | 52 | let example = Example() 53 | example.number = 5 54 | example.testProperty = "" // It's empty! 55 | 56 | let result = validation.runValidation(example) 57 | 58 | XCTAssertTrue(result) 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Example/Tests/ValidatorsTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ValidatorsTests.swift 3 | // FluidValidator 4 | // 5 | // Created by FrogRain on 06/02/16. 6 | // Copyright © 2016 CocoaPods. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | import FluidValidator 11 | 12 | class ValidatorsTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testBeNotNil() { 25 | let validation = Validation(name: "testValidation") { (context:Example) -> (Any?) in 26 | return context.testProperty 27 | } 28 | let rule = BeNotNil() 29 | validation.addRule(rule) 30 | 31 | let example = Example() 32 | 33 | var result = validation.runValidation(example) 34 | 35 | var failMessage = validation.allErrors 36 | 37 | XCTAssertFalse(result) 38 | XCTAssertTrue(failMessage.errors.count > 0) 39 | 40 | example.testProperty = "test value" 41 | result = validation.runValidation(example) 42 | failMessage = validation.allErrors 43 | 44 | XCTAssertTrue(result) 45 | XCTAssertTrue(failMessage.errors.count == 0) 46 | } 47 | 48 | func testBeNotEmpty() { 49 | let validation = Validation(name: "testValidation") { (context:Example) -> (Any?) in 50 | return context.testProperty 51 | } 52 | let rule = BeNotEmpty() 53 | validation.addRule(rule) 54 | 55 | let example = Example() 56 | 57 | example.testProperty = "" 58 | var result = validation.runValidation(example) 59 | var failMessage = validation.allErrors 60 | XCTAssertFalse(result) 61 | XCTAssertTrue(failMessage.errors.count > 0) 62 | 63 | example.testProperty = "test value" 64 | result = validation.runValidation(example) 65 | failMessage = validation.allErrors 66 | 67 | XCTAssertTrue(result) 68 | XCTAssertTrue(failMessage.errors.count == 0) 69 | } 70 | 71 | func testBeTrue() { 72 | let validation = Validation(name: "testValidation") { (context:Example) -> (Any?) in 73 | return context.isTrue 74 | } 75 | let rule = BeTrue() 76 | validation.addRule(rule) 77 | 78 | let example = Example() 79 | 80 | example.isTrue = false 81 | var result = validation.runValidation(example) 82 | var failMessage = validation.allErrors 83 | XCTAssertFalse(result) 84 | XCTAssertTrue(failMessage.errors.count > 0) 85 | 86 | example.isTrue = true 87 | result = validation.runValidation(example) 88 | failMessage = validation.allErrors 89 | 90 | XCTAssertTrue(result) 91 | XCTAssertTrue(failMessage.errors.count == 0) 92 | } 93 | 94 | func testGreaterThan() { 95 | let validation = Validation(name: "testValidation") { (context:Example) -> (Any?) in 96 | return context.number 97 | } 98 | let rule = GreaterThan(limit: 4, includeLimit: true) 99 | validation.addRule(rule) 100 | 101 | let example = Example() 102 | 103 | example.number = 0 104 | var result = validation.runValidation(example) 105 | var failMessage = validation.allErrors 106 | XCTAssertFalse(result) 107 | XCTAssertTrue(failMessage.errors.count > 0) 108 | 109 | example.number = 4 110 | result = validation.runValidation(example) 111 | failMessage = validation.allErrors 112 | XCTAssertTrue(result) 113 | XCTAssertTrue(failMessage.errors.count == 0) 114 | 115 | example.number = 5 116 | result = validation.runValidation(example) 117 | failMessage = validation.allErrors 118 | XCTAssertTrue(result) 119 | XCTAssertTrue(failMessage.errors.count == 0) 120 | } 121 | 122 | func testLessThan() { 123 | let validation = Validation(name: "testValidation") { (context:Example) -> (Any?) in 124 | return context.number 125 | } 126 | let rule = LessThan(limit: 4, includeLimit: true) 127 | validation.addRule(rule) 128 | 129 | let example = Example() 130 | 131 | example.number = 5 132 | var result = validation.runValidation(example) 133 | var failMessage = validation.allErrors 134 | XCTAssertFalse(result) 135 | XCTAssertTrue(failMessage.errors.count > 0) 136 | 137 | example.number = 4 138 | result = validation.runValidation(example) 139 | failMessage = validation.allErrors 140 | XCTAssertTrue(result) 141 | XCTAssertTrue(failMessage.errors.count == 0) 142 | 143 | example.number = 3 144 | result = validation.runValidation(example) 145 | failMessage = validation.allErrors 146 | XCTAssertTrue(result) 147 | XCTAssertTrue(failMessage.errors.count == 0) 148 | } 149 | 150 | func testInRange() { 151 | let validation = Validation(name: "testValidation") { (context:Example) -> (Any?) in 152 | return context.number 153 | } 154 | let rule = InRange(min: 1, max: 5, mode: .MinMaxExluded) 155 | validation.addRule(rule) 156 | 157 | let example = Example() 158 | example.number = 6 159 | var result = validation.runValidation(example) 160 | var failMessage = validation.allErrors 161 | XCTAssertFalse(result) 162 | XCTAssertTrue(failMessage.errors.count > 0) 163 | 164 | example.number = 4 165 | result = validation.runValidation(example) 166 | failMessage = validation.allErrors 167 | XCTAssertTrue(result) 168 | XCTAssertTrue(failMessage.errors.count == 0) 169 | 170 | example.number = 3 171 | result = validation.runValidation(example) 172 | failMessage = validation.allErrors 173 | XCTAssertTrue(result) 174 | XCTAssertTrue(failMessage.errors.count == 0) 175 | 176 | } 177 | 178 | func testRegexMatch() { 179 | let validation = Validation(name: "testValidation") { (context:Example) -> (Any?) in 180 | return context.altProperty 181 | } 182 | let rule = RegexMatch(regex: "^aaa.+$") 183 | validation.addRule(rule) 184 | 185 | let example = Example() 186 | example.altProperty = "bbbbasdasd" 187 | var result = validation.runValidation(example) 188 | var failMessage = validation.allErrors 189 | XCTAssertFalse(result) 190 | XCTAssertTrue(failMessage.errors.count > 0) 191 | 192 | example.altProperty = "aaabbbbasdasd" 193 | result = validation.runValidation(example) 194 | failMessage = validation.allErrors 195 | XCTAssertTrue(result) 196 | XCTAssertTrue(failMessage.errors.count == 0) 197 | } 198 | 199 | 200 | func testValidEmail() { 201 | let validation = Validation(name: "testValidation") { (context:Example) -> (Any?) in 202 | return context.altProperty 203 | } 204 | let rule = ValidEmail() 205 | validation.addRule(rule) 206 | 207 | let example = Example() 208 | example.altProperty = "wrongAT.email.it" 209 | var result = validation.runValidation(example) 210 | var failMessage = validation.allErrors 211 | XCTAssertFalse(result) 212 | XCTAssertTrue(failMessage.errors.count > 0) 213 | 214 | example.altProperty = "info@frograin.com" 215 | result = validation.runValidation(example) 216 | failMessage = validation.allErrors 217 | XCTAssertTrue(result) 218 | XCTAssertTrue(failMessage.errors.count == 0) 219 | } 220 | } 221 | -------------------------------------------------------------------------------- /FluidValidator.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint FluidValidator.podspec' to ensure this is a 3 | # valid spec before submitting. 4 | # 5 | # Any lines starting with a # are optional, but their use is encouraged 6 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = "FluidValidator" 11 | s.version = "0.1.6" 12 | s.summary = "General purpose object validator" 13 | 14 | s.description = <<-DESC 15 | FluidValidator is intended to encapsulate validation logic. The API was designed with FluentValidation (https://github.com/JeremySkinner/FluentValidation) and Rails Validation as reference. 16 | Currently offers validation of simple objects, complex objects (object graph), enumerables. Localized error messages. You can easly override base behaviors and/or build your own reusable validation rules. 17 | DESC 18 | 19 | s.homepage = "https://github.com/frograin/FluidValidator" 20 | s.license = 'MIT' 21 | s.author = { "FrogRain" => "info@frograin.com" } 22 | s.source = { :git => "https://github.com/frograin/FluidValidator.git", :tag => s.version.to_s } 23 | 24 | s.platform = :ios, '8.0' 25 | s.requires_arc = true 26 | 27 | s.source_files = 'Pod/Classes/**/*' 28 | s.resource = 'Pod/FluidValidator.bundle' 29 | end 30 | -------------------------------------------------------------------------------- /Framework/FluidValidator/FluidValidator.h: -------------------------------------------------------------------------------- 1 | // 2 | // FluidValidator.h 3 | // FluidValidator 4 | // 5 | // Created by Antonio Di Giacomo on 19/04/2017. 6 | // Copyright © 2017 Frograin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for FluidValidator. 12 | FOUNDATION_EXPORT double FluidValidatorVersionNumber; 13 | 14 | //! Project version string for FluidValidator. 15 | FOUNDATION_EXPORT const unsigned char FluidValidatorVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Framework/FluidValidator/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Framework/Framework.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 165EFE031EA7EAAD002D452A /* FluidValidator.h in Headers */ = {isa = PBXBuildFile; fileRef = 165EFE011EA7EAAD002D452A /* FluidValidator.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | 165EFE1C1EA7EAEE002D452A /* AbstractValidationRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 165EFE071EA7EAEE002D452A /* AbstractValidationRule.swift */; }; 12 | 165EFE1D1EA7EAEE002D452A /* AbstractValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 165EFE081EA7EAEE002D452A /* AbstractValidator.swift */; }; 13 | 165EFE1E1EA7EAEE002D452A /* EnumeratorValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 165EFE091EA7EAEE002D452A /* EnumeratorValidator.swift */; }; 14 | 165EFE1F1EA7EAEE002D452A /* ErrorMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 165EFE0A1EA7EAEE002D452A /* ErrorMessage.swift */; }; 15 | 165EFE201EA7EAEE002D452A /* FailMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 165EFE0B1EA7EAEE002D452A /* FailMessage.swift */; }; 16 | 165EFE211EA7EAEE002D452A /* LocalizationHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 165EFE0C1EA7EAEE002D452A /* LocalizationHelper.swift */; }; 17 | 165EFE221EA7EAEE002D452A /* Validatable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 165EFE0D1EA7EAEE002D452A /* Validatable.swift */; }; 18 | 165EFE231EA7EAEE002D452A /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 165EFE0E1EA7EAEE002D452A /* Validation.swift */; }; 19 | 165EFE241EA7EAEE002D452A /* ValidationBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 165EFE0F1EA7EAEE002D452A /* ValidationBase.swift */; }; 20 | 165EFE251EA7EAEE002D452A /* BeNotEmpty.swift in Sources */ = {isa = PBXBuildFile; fileRef = 165EFE111EA7EAEE002D452A /* BeNotEmpty.swift */; }; 21 | 165EFE261EA7EAEE002D452A /* BeNotNil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 165EFE121EA7EAEE002D452A /* BeNotNil.swift */; }; 22 | 165EFE271EA7EAEE002D452A /* BeTrue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 165EFE131EA7EAEE002D452A /* BeTrue.swift */; }; 23 | 165EFE281EA7EAEE002D452A /* GenericRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 165EFE141EA7EAEE002D452A /* GenericRule.swift */; }; 24 | 165EFE291EA7EAEE002D452A /* GreaterThan.swift in Sources */ = {isa = PBXBuildFile; fileRef = 165EFE151EA7EAEE002D452A /* GreaterThan.swift */; }; 25 | 165EFE2A1EA7EAEE002D452A /* InRange.swift in Sources */ = {isa = PBXBuildFile; fileRef = 165EFE161EA7EAEE002D452A /* InRange.swift */; }; 26 | 165EFE2B1EA7EAEE002D452A /* LessThan.swift in Sources */ = {isa = PBXBuildFile; fileRef = 165EFE171EA7EAEE002D452A /* LessThan.swift */; }; 27 | 165EFE2C1EA7EAEE002D452A /* RegexMatch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 165EFE181EA7EAEE002D452A /* RegexMatch.swift */; }; 28 | 165EFE2D1EA7EAEE002D452A /* ValidEmail.swift in Sources */ = {isa = PBXBuildFile; fileRef = 165EFE191EA7EAEE002D452A /* ValidEmail.swift */; }; 29 | 165EFE311EA7EAF7002D452A /* FluidValidator.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 165EFE2E1EA7EAF7002D452A /* FluidValidator.bundle */; }; 30 | /* End PBXBuildFile section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | 165EFDFF1EA7EAAD002D452A /* FluidValidator.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = FluidValidator.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | 165EFE011EA7EAAD002D452A /* FluidValidator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FluidValidator.h; sourceTree = ""; }; 35 | 165EFE021EA7EAAD002D452A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 36 | 165EFE071EA7EAEE002D452A /* AbstractValidationRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AbstractValidationRule.swift; sourceTree = ""; }; 37 | 165EFE081EA7EAEE002D452A /* AbstractValidator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AbstractValidator.swift; sourceTree = ""; }; 38 | 165EFE091EA7EAEE002D452A /* EnumeratorValidator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EnumeratorValidator.swift; sourceTree = ""; }; 39 | 165EFE0A1EA7EAEE002D452A /* ErrorMessage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ErrorMessage.swift; sourceTree = ""; }; 40 | 165EFE0B1EA7EAEE002D452A /* FailMessage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FailMessage.swift; sourceTree = ""; }; 41 | 165EFE0C1EA7EAEE002D452A /* LocalizationHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocalizationHelper.swift; sourceTree = ""; }; 42 | 165EFE0D1EA7EAEE002D452A /* Validatable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Validatable.swift; sourceTree = ""; }; 43 | 165EFE0E1EA7EAEE002D452A /* Validation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Validation.swift; sourceTree = ""; }; 44 | 165EFE0F1EA7EAEE002D452A /* ValidationBase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValidationBase.swift; sourceTree = ""; }; 45 | 165EFE111EA7EAEE002D452A /* BeNotEmpty.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BeNotEmpty.swift; sourceTree = ""; }; 46 | 165EFE121EA7EAEE002D452A /* BeNotNil.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BeNotNil.swift; sourceTree = ""; }; 47 | 165EFE131EA7EAEE002D452A /* BeTrue.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BeTrue.swift; sourceTree = ""; }; 48 | 165EFE141EA7EAEE002D452A /* GenericRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GenericRule.swift; sourceTree = ""; }; 49 | 165EFE151EA7EAEE002D452A /* GreaterThan.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GreaterThan.swift; sourceTree = ""; }; 50 | 165EFE161EA7EAEE002D452A /* InRange.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InRange.swift; sourceTree = ""; }; 51 | 165EFE171EA7EAEE002D452A /* LessThan.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LessThan.swift; sourceTree = ""; }; 52 | 165EFE181EA7EAEE002D452A /* RegexMatch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RegexMatch.swift; sourceTree = ""; }; 53 | 165EFE191EA7EAEE002D452A /* ValidEmail.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValidEmail.swift; sourceTree = ""; }; 54 | 165EFE2E1EA7EAF7002D452A /* FluidValidator.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = FluidValidator.bundle; sourceTree = ""; }; 55 | /* End PBXFileReference section */ 56 | 57 | /* Begin PBXFrameworksBuildPhase section */ 58 | 165EFDFB1EA7EAAD002D452A /* Frameworks */ = { 59 | isa = PBXFrameworksBuildPhase; 60 | buildActionMask = 2147483647; 61 | files = ( 62 | ); 63 | runOnlyForDeploymentPostprocessing = 0; 64 | }; 65 | /* End PBXFrameworksBuildPhase section */ 66 | 67 | /* Begin PBXGroup section */ 68 | 165EFDE51EA7EA99002D452A = { 69 | isa = PBXGroup; 70 | children = ( 71 | 165EFE001EA7EAAD002D452A /* FluidValidator */, 72 | 165EFDF01EA7EA99002D452A /* Products */, 73 | ); 74 | sourceTree = ""; 75 | }; 76 | 165EFDF01EA7EA99002D452A /* Products */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | 165EFDFF1EA7EAAD002D452A /* FluidValidator.framework */, 80 | ); 81 | name = Products; 82 | sourceTree = ""; 83 | }; 84 | 165EFE001EA7EAAD002D452A /* FluidValidator */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | 165EFE1B1EA7EAEE002D452A /* Classes */, 88 | 165EFE301EA7EAF7002D452A /* Resources */, 89 | 165EFE011EA7EAAD002D452A /* FluidValidator.h */, 90 | 165EFE021EA7EAAD002D452A /* Info.plist */, 91 | ); 92 | path = FluidValidator; 93 | sourceTree = ""; 94 | }; 95 | 165EFE101EA7EAEE002D452A /* Core */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | 165EFE071EA7EAEE002D452A /* AbstractValidationRule.swift */, 99 | 165EFE081EA7EAEE002D452A /* AbstractValidator.swift */, 100 | 165EFE091EA7EAEE002D452A /* EnumeratorValidator.swift */, 101 | 165EFE0A1EA7EAEE002D452A /* ErrorMessage.swift */, 102 | 165EFE0B1EA7EAEE002D452A /* FailMessage.swift */, 103 | 165EFE0C1EA7EAEE002D452A /* LocalizationHelper.swift */, 104 | 165EFE0D1EA7EAEE002D452A /* Validatable.swift */, 105 | 165EFE0E1EA7EAEE002D452A /* Validation.swift */, 106 | 165EFE0F1EA7EAEE002D452A /* ValidationBase.swift */, 107 | ); 108 | path = Core; 109 | sourceTree = ""; 110 | }; 111 | 165EFE1A1EA7EAEE002D452A /* Validators */ = { 112 | isa = PBXGroup; 113 | children = ( 114 | 165EFE111EA7EAEE002D452A /* BeNotEmpty.swift */, 115 | 165EFE121EA7EAEE002D452A /* BeNotNil.swift */, 116 | 165EFE131EA7EAEE002D452A /* BeTrue.swift */, 117 | 165EFE141EA7EAEE002D452A /* GenericRule.swift */, 118 | 165EFE151EA7EAEE002D452A /* GreaterThan.swift */, 119 | 165EFE161EA7EAEE002D452A /* InRange.swift */, 120 | 165EFE171EA7EAEE002D452A /* LessThan.swift */, 121 | 165EFE181EA7EAEE002D452A /* RegexMatch.swift */, 122 | 165EFE191EA7EAEE002D452A /* ValidEmail.swift */, 123 | ); 124 | path = Validators; 125 | sourceTree = ""; 126 | }; 127 | 165EFE1B1EA7EAEE002D452A /* Classes */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | 165EFE101EA7EAEE002D452A /* Core */, 131 | 165EFE1A1EA7EAEE002D452A /* Validators */, 132 | ); 133 | name = Classes; 134 | path = ../../Pod/Classes; 135 | sourceTree = ""; 136 | }; 137 | 165EFE2F1EA7EAF7002D452A /* Pod */ = { 138 | isa = PBXGroup; 139 | children = ( 140 | 165EFE2E1EA7EAF7002D452A /* FluidValidator.bundle */, 141 | ); 142 | path = Pod; 143 | sourceTree = ""; 144 | }; 145 | 165EFE301EA7EAF7002D452A /* Resources */ = { 146 | isa = PBXGroup; 147 | children = ( 148 | 165EFE2F1EA7EAF7002D452A /* Pod */, 149 | ); 150 | name = Resources; 151 | path = ../..; 152 | sourceTree = ""; 153 | }; 154 | /* End PBXGroup section */ 155 | 156 | /* Begin PBXHeadersBuildPhase section */ 157 | 165EFDFC1EA7EAAD002D452A /* Headers */ = { 158 | isa = PBXHeadersBuildPhase; 159 | buildActionMask = 2147483647; 160 | files = ( 161 | 165EFE031EA7EAAD002D452A /* FluidValidator.h in Headers */, 162 | ); 163 | runOnlyForDeploymentPostprocessing = 0; 164 | }; 165 | /* End PBXHeadersBuildPhase section */ 166 | 167 | /* Begin PBXNativeTarget section */ 168 | 165EFDFE1EA7EAAD002D452A /* FluidValidator */ = { 169 | isa = PBXNativeTarget; 170 | buildConfigurationList = 165EFE041EA7EAAD002D452A /* Build configuration list for PBXNativeTarget "FluidValidator" */; 171 | buildPhases = ( 172 | 165EFDFA1EA7EAAD002D452A /* Sources */, 173 | 165EFDFB1EA7EAAD002D452A /* Frameworks */, 174 | 165EFDFC1EA7EAAD002D452A /* Headers */, 175 | 165EFDFD1EA7EAAD002D452A /* Resources */, 176 | ); 177 | buildRules = ( 178 | ); 179 | dependencies = ( 180 | ); 181 | name = FluidValidator; 182 | productName = FluidValidator; 183 | productReference = 165EFDFF1EA7EAAD002D452A /* FluidValidator.framework */; 184 | productType = "com.apple.product-type.framework"; 185 | }; 186 | /* End PBXNativeTarget section */ 187 | 188 | /* Begin PBXProject section */ 189 | 165EFDE61EA7EA99002D452A /* Project object */ = { 190 | isa = PBXProject; 191 | attributes = { 192 | LastUpgradeCheck = 0820; 193 | ORGANIZATIONNAME = Frograin; 194 | TargetAttributes = { 195 | 165EFDFE1EA7EAAD002D452A = { 196 | CreatedOnToolsVersion = 8.2.1; 197 | DevelopmentTeam = 7ANT8E5L74; 198 | ProvisioningStyle = Automatic; 199 | }; 200 | }; 201 | }; 202 | buildConfigurationList = 165EFDE91EA7EA99002D452A /* Build configuration list for PBXProject "Framework" */; 203 | compatibilityVersion = "Xcode 3.2"; 204 | developmentRegion = English; 205 | hasScannedForEncodings = 0; 206 | knownRegions = ( 207 | en, 208 | ); 209 | mainGroup = 165EFDE51EA7EA99002D452A; 210 | productRefGroup = 165EFDF01EA7EA99002D452A /* Products */; 211 | projectDirPath = ""; 212 | projectRoot = ""; 213 | targets = ( 214 | 165EFDFE1EA7EAAD002D452A /* FluidValidator */, 215 | ); 216 | }; 217 | /* End PBXProject section */ 218 | 219 | /* Begin PBXResourcesBuildPhase section */ 220 | 165EFDFD1EA7EAAD002D452A /* Resources */ = { 221 | isa = PBXResourcesBuildPhase; 222 | buildActionMask = 2147483647; 223 | files = ( 224 | 165EFE311EA7EAF7002D452A /* FluidValidator.bundle in Resources */, 225 | ); 226 | runOnlyForDeploymentPostprocessing = 0; 227 | }; 228 | /* End PBXResourcesBuildPhase section */ 229 | 230 | /* Begin PBXSourcesBuildPhase section */ 231 | 165EFDFA1EA7EAAD002D452A /* Sources */ = { 232 | isa = PBXSourcesBuildPhase; 233 | buildActionMask = 2147483647; 234 | files = ( 235 | 165EFE261EA7EAEE002D452A /* BeNotNil.swift in Sources */, 236 | 165EFE2D1EA7EAEE002D452A /* ValidEmail.swift in Sources */, 237 | 165EFE201EA7EAEE002D452A /* FailMessage.swift in Sources */, 238 | 165EFE241EA7EAEE002D452A /* ValidationBase.swift in Sources */, 239 | 165EFE1F1EA7EAEE002D452A /* ErrorMessage.swift in Sources */, 240 | 165EFE211EA7EAEE002D452A /* LocalizationHelper.swift in Sources */, 241 | 165EFE251EA7EAEE002D452A /* BeNotEmpty.swift in Sources */, 242 | 165EFE2A1EA7EAEE002D452A /* InRange.swift in Sources */, 243 | 165EFE1D1EA7EAEE002D452A /* AbstractValidator.swift in Sources */, 244 | 165EFE1C1EA7EAEE002D452A /* AbstractValidationRule.swift in Sources */, 245 | 165EFE1E1EA7EAEE002D452A /* EnumeratorValidator.swift in Sources */, 246 | 165EFE231EA7EAEE002D452A /* Validation.swift in Sources */, 247 | 165EFE2C1EA7EAEE002D452A /* RegexMatch.swift in Sources */, 248 | 165EFE2B1EA7EAEE002D452A /* LessThan.swift in Sources */, 249 | 165EFE271EA7EAEE002D452A /* BeTrue.swift in Sources */, 250 | 165EFE291EA7EAEE002D452A /* GreaterThan.swift in Sources */, 251 | 165EFE221EA7EAEE002D452A /* Validatable.swift in Sources */, 252 | 165EFE281EA7EAEE002D452A /* GenericRule.swift in Sources */, 253 | ); 254 | runOnlyForDeploymentPostprocessing = 0; 255 | }; 256 | /* End PBXSourcesBuildPhase section */ 257 | 258 | /* Begin XCBuildConfiguration section */ 259 | 165EFDF51EA7EA99002D452A /* Debug */ = { 260 | isa = XCBuildConfiguration; 261 | buildSettings = { 262 | ALWAYS_SEARCH_USER_PATHS = NO; 263 | CLANG_ANALYZER_NONNULL = YES; 264 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 265 | CLANG_CXX_LIBRARY = "libc++"; 266 | CLANG_ENABLE_MODULES = YES; 267 | CLANG_ENABLE_OBJC_ARC = YES; 268 | CLANG_WARN_BOOL_CONVERSION = YES; 269 | CLANG_WARN_CONSTANT_CONVERSION = YES; 270 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 271 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 272 | CLANG_WARN_EMPTY_BODY = YES; 273 | CLANG_WARN_ENUM_CONVERSION = YES; 274 | CLANG_WARN_INFINITE_RECURSION = YES; 275 | CLANG_WARN_INT_CONVERSION = YES; 276 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 277 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 278 | CLANG_WARN_UNREACHABLE_CODE = YES; 279 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 280 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 281 | COPY_PHASE_STRIP = NO; 282 | CURRENT_PROJECT_VERSION = 1; 283 | DEBUG_INFORMATION_FORMAT = dwarf; 284 | ENABLE_STRICT_OBJC_MSGSEND = YES; 285 | ENABLE_TESTABILITY = YES; 286 | GCC_C_LANGUAGE_STANDARD = gnu99; 287 | GCC_DYNAMIC_NO_PIC = NO; 288 | GCC_NO_COMMON_BLOCKS = YES; 289 | GCC_OPTIMIZATION_LEVEL = 0; 290 | GCC_PREPROCESSOR_DEFINITIONS = ( 291 | "DEBUG=1", 292 | "$(inherited)", 293 | ); 294 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 295 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 296 | GCC_WARN_UNDECLARED_SELECTOR = YES; 297 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 298 | GCC_WARN_UNUSED_FUNCTION = YES; 299 | GCC_WARN_UNUSED_VARIABLE = YES; 300 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 301 | MTL_ENABLE_DEBUG_INFO = YES; 302 | ONLY_ACTIVE_ARCH = YES; 303 | SDKROOT = iphoneos; 304 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 305 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 306 | TARGETED_DEVICE_FAMILY = "1,2"; 307 | VERSIONING_SYSTEM = "apple-generic"; 308 | VERSION_INFO_PREFIX = ""; 309 | }; 310 | name = Debug; 311 | }; 312 | 165EFDF61EA7EA99002D452A /* Release */ = { 313 | isa = XCBuildConfiguration; 314 | buildSettings = { 315 | ALWAYS_SEARCH_USER_PATHS = NO; 316 | CLANG_ANALYZER_NONNULL = YES; 317 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 318 | CLANG_CXX_LIBRARY = "libc++"; 319 | CLANG_ENABLE_MODULES = YES; 320 | CLANG_ENABLE_OBJC_ARC = YES; 321 | CLANG_WARN_BOOL_CONVERSION = YES; 322 | CLANG_WARN_CONSTANT_CONVERSION = YES; 323 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 324 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 325 | CLANG_WARN_EMPTY_BODY = YES; 326 | CLANG_WARN_ENUM_CONVERSION = YES; 327 | CLANG_WARN_INFINITE_RECURSION = YES; 328 | CLANG_WARN_INT_CONVERSION = YES; 329 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 330 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 331 | CLANG_WARN_UNREACHABLE_CODE = YES; 332 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 333 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 334 | COPY_PHASE_STRIP = NO; 335 | CURRENT_PROJECT_VERSION = 1; 336 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 337 | ENABLE_NS_ASSERTIONS = NO; 338 | ENABLE_STRICT_OBJC_MSGSEND = YES; 339 | GCC_C_LANGUAGE_STANDARD = gnu99; 340 | GCC_NO_COMMON_BLOCKS = YES; 341 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 342 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 343 | GCC_WARN_UNDECLARED_SELECTOR = YES; 344 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 345 | GCC_WARN_UNUSED_FUNCTION = YES; 346 | GCC_WARN_UNUSED_VARIABLE = YES; 347 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 348 | MTL_ENABLE_DEBUG_INFO = NO; 349 | SDKROOT = iphoneos; 350 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 351 | TARGETED_DEVICE_FAMILY = "1,2"; 352 | VALIDATE_PRODUCT = YES; 353 | VERSIONING_SYSTEM = "apple-generic"; 354 | VERSION_INFO_PREFIX = ""; 355 | }; 356 | name = Release; 357 | }; 358 | 165EFE051EA7EAAD002D452A /* Debug */ = { 359 | isa = XCBuildConfiguration; 360 | buildSettings = { 361 | CODE_SIGN_IDENTITY = ""; 362 | DEFINES_MODULE = YES; 363 | DEVELOPMENT_TEAM = 7ANT8E5L74; 364 | DYLIB_COMPATIBILITY_VERSION = 1; 365 | DYLIB_CURRENT_VERSION = 1; 366 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 367 | INFOPLIST_FILE = FluidValidator/Info.plist; 368 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 369 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 370 | PRODUCT_BUNDLE_IDENTIFIER = com.frograin.FluidValidator; 371 | PRODUCT_NAME = "$(TARGET_NAME)"; 372 | SKIP_INSTALL = YES; 373 | SWIFT_VERSION = 3.0; 374 | }; 375 | name = Debug; 376 | }; 377 | 165EFE061EA7EAAD002D452A /* Release */ = { 378 | isa = XCBuildConfiguration; 379 | buildSettings = { 380 | CODE_SIGN_IDENTITY = ""; 381 | DEFINES_MODULE = YES; 382 | DEVELOPMENT_TEAM = 7ANT8E5L74; 383 | DYLIB_COMPATIBILITY_VERSION = 1; 384 | DYLIB_CURRENT_VERSION = 1; 385 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 386 | INFOPLIST_FILE = FluidValidator/Info.plist; 387 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 388 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 389 | PRODUCT_BUNDLE_IDENTIFIER = com.frograin.FluidValidator; 390 | PRODUCT_NAME = "$(TARGET_NAME)"; 391 | SKIP_INSTALL = YES; 392 | SWIFT_VERSION = 3.0; 393 | }; 394 | name = Release; 395 | }; 396 | /* End XCBuildConfiguration section */ 397 | 398 | /* Begin XCConfigurationList section */ 399 | 165EFDE91EA7EA99002D452A /* Build configuration list for PBXProject "Framework" */ = { 400 | isa = XCConfigurationList; 401 | buildConfigurations = ( 402 | 165EFDF51EA7EA99002D452A /* Debug */, 403 | 165EFDF61EA7EA99002D452A /* Release */, 404 | ); 405 | defaultConfigurationIsVisible = 0; 406 | defaultConfigurationName = Release; 407 | }; 408 | 165EFE041EA7EAAD002D452A /* Build configuration list for PBXNativeTarget "FluidValidator" */ = { 409 | isa = XCConfigurationList; 410 | buildConfigurations = ( 411 | 165EFE051EA7EAAD002D452A /* Debug */, 412 | 165EFE061EA7EAAD002D452A /* Release */, 413 | ); 414 | defaultConfigurationIsVisible = 0; 415 | }; 416 | /* End XCConfigurationList section */ 417 | }; 418 | rootObject = 165EFDE61EA7EA99002D452A /* Project object */; 419 | } 420 | -------------------------------------------------------------------------------- /Framework/Framework.xcodeproj/xcshareddata/xcschemes/FluidValidator.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 FrogRain 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pod/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digiacomo/FluidValidator/d4a164d45245d2eac7967295f87890ae80e93246/Pod/Classes/.gitkeep -------------------------------------------------------------------------------- /Pod/Classes/Core/AbstractValidationRule.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ValidationRule.swift 3 | // TestValidator 4 | // 5 | // Created by FrogRain on 31/01/16. 6 | // Copyright © 2016 FrogRain. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | open class AbstractValidationRule: ValidationBase { 12 | 13 | override open func performValidation(onObject object: AnyObject?) -> Bool { 14 | fatalError("Not implemented error") 15 | } 16 | 17 | override open func hydrateError(withFailMessage message: FailMessage, localizedSubject: String, failValue: AnyObject?, context: AnyObject) { 18 | let error = ErrorMessage() 19 | error.compact = self.errorMessage(localizedSubject, failValue: failValue, context: context) 20 | error.extended = self.errorMessageExtended(localizedSubject, failValue: failValue, context: context) 21 | message.errors.append(error) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Pod/Classes/Core/AbstractValidator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AbstractValidator.swift 3 | // TestValidator 4 | // 5 | // Created by FrogRain on 31/01/16. 6 | // Copyright © 2016 FrogRain. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | open class AbstractValidator : ValidationBase { 12 | fileprivate var validations:Array> = Array>() 13 | 14 | public override init() { 15 | super.init() 16 | } 17 | 18 | open func validate(object target: AnyObject?) -> Bool { 19 | var result = true 20 | for validation in self.validations { 21 | guard let target = target as? T else { 22 | continue 23 | } 24 | let validationResult = self.validate(property: validation.validationName, context: target) 25 | result = result && validationResult 26 | } 27 | return result 28 | } 29 | 30 | func validate(property name:String, context: T) -> Bool { 31 | let validations = self.validations.filter({(validation) -> Bool in 32 | validation.validationName == name 33 | }) 34 | var validationResult = true 35 | for validation in validations { 36 | let result = validation.runValidation(context) 37 | validationResult = validationResult && result 38 | } 39 | return validationResult 40 | } 41 | 42 | @discardableResult open func addValidation(withName name:String, targetGetter:@escaping (_ context:T)->(Any?)) -> Validation { 43 | let validation = Validation(name: name, targetGetter: targetGetter) 44 | self.validations.append(validation) 45 | return validation 46 | } 47 | 48 | open func addValidation(forProperty property: Selector) -> Void { 49 | let name = String(describing: property) 50 | addValidation(withName: name) { (context) -> (AnyObject?) in 51 | 52 | guard let nsContext = context as? NSObject else { 53 | return nil 54 | } 55 | return nsContext.perform(property) as AnyObject 56 | } 57 | } 58 | 59 | open var allErrors: FailMessage { 60 | let error = FailMessage() 61 | let validationNames = self.validations.map({(validation) -> String in 62 | validation.validationName 63 | }) 64 | for name in validationNames { 65 | let failMessage = self.errorsForValidation(name) 66 | if(failMessage.errors.count == 0 && failMessage.failingFields().count == 0) { 67 | continue 68 | } 69 | error.setObject(failMessage, forKey: name) 70 | } 71 | return error 72 | } 73 | 74 | 75 | func errorsForValidation(_ name:String) -> FailMessage { 76 | let validations = self.validations.filter { (validation) -> Bool in 77 | validation.validationName == name 78 | } 79 | 80 | let failMessage = validations.first?.allErrors ?? FailMessage() 81 | for validation in validations { 82 | let validationFail = validation.allErrors 83 | let joinedArrays = failMessage.errors + validationFail.errors 84 | failMessage.errors = Array(Set(joinedArrays)) 85 | } 86 | return failMessage 87 | } 88 | 89 | // override ValidationBase (which implements Validatable) 90 | override open func performValidation(onObject object:AnyObject?) -> Bool { 91 | if let object = object as? T { 92 | return self.validate(object: object) 93 | } 94 | return false 95 | } 96 | 97 | override open func hydrateError(withFailMessage message: FailMessage, localizedSubject: String, failValue: AnyObject?, context: AnyObject) { 98 | let error = ErrorMessage() 99 | error.compact = self.errorMessage(localizedSubject, failValue: failValue, context: context) 100 | error.extended = self.errorMessageExtended(localizedSubject, failValue: failValue, context: context) 101 | message.errors.append(error) 102 | 103 | for validation in self.validations { 104 | message.setObject(validation.allErrors, forKey: validation.validationName) 105 | } 106 | } 107 | 108 | override func errorTextLocalized() -> String { 109 | var message = super.errorTextLocalized() 110 | let className = String(describing: type(of: self).self) 111 | var key = String(format: "%@.error.message", className) 112 | if(message == key) { 113 | key = "AbstractValidator.error.message" 114 | message = LocalizationHelper.localizeThis(key) 115 | } 116 | return message 117 | } 118 | 119 | override func errorTextExtendedLocalized() -> String { 120 | var message = super.errorTextExtendedLocalized() 121 | let className = String(describing: type(of: self).self) 122 | var key = String(format: "%@.error.message.extended", className) 123 | if(message == key) { 124 | key = "AbstractValidator.error.message.extended" 125 | message = LocalizationHelper.localizeThis(key) 126 | } 127 | return message 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /Pod/Classes/Core/EnumeratorValidator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EnumeratorValidator.swift 3 | // Pods 4 | // 5 | // Created by FrogRain on 07/02/16. 6 | // 7 | // 8 | 9 | import Foundation 10 | 11 | open class EnumeratorValidator: AbstractValidator { 12 | fileprivate var validatable:Validatable 13 | 14 | public init(validatable:Validatable){ 15 | self.validatable = validatable 16 | super.init() 17 | } 18 | 19 | open override func performValidation(onObject object: AnyObject?) -> Bool { 20 | guard let object = object else { 21 | return false 22 | } 23 | return self.validate(object: object) 24 | } 25 | 26 | override open func validate(object: AnyObject?) -> Bool { 27 | guard let arrObjects = object as? Array else { 28 | return false 29 | } 30 | let dict = NSMutableDictionary() 31 | for (index, value) in arrObjects.enumerated() { 32 | dict.setObject(value, forKey: index.description as NSCopying) 33 | self.addValidation(withName: index.description, targetGetter: { (context) -> (AnyObject?) in 34 | value 35 | }).addRule(self.validatable) 36 | } 37 | return super.validate(object: dict) 38 | } 39 | 40 | override open func hydrateError(withFailMessage message: FailMessage, localizedSubject: String, failValue: AnyObject?, context: AnyObject) { 41 | let error = ErrorMessage() 42 | error.compact = self.errorMessage(localizedSubject, failValue: failValue, context: context) 43 | error.extended = self.errorMessageExtended(localizedSubject, failValue: failValue, context: context) 44 | 45 | message.errors.append(error) 46 | 47 | guard let arrObject = failValue as? Array else { 48 | return 49 | } 50 | for(index, _) in arrObject.enumerated() { 51 | let error = self.errorsForValidation(index.description) 52 | message.setObject(error, forKey: index.description) 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Pod/Classes/Core/ErrorMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ErrorMessage.swift 3 | // Pods 4 | // 5 | // Created by FrogRain on 07/02/16. 6 | // 7 | // 8 | 9 | import Foundation 10 | 11 | public func ==(lhs: ErrorMessage, rhs: ErrorMessage) -> Bool { 12 | return lhs.hashValue == rhs.hashValue 13 | } 14 | 15 | func ==(lhs: Array, rhs: Array) -> Bool { 16 | return lhs.hash == lhs.hash 17 | } 18 | 19 | extension Array where Element:ErrorMessage { 20 | var hash: Int { 21 | get { 22 | var hash = 0 23 | forEach { (x: Array.Iterator.Element) -> () in 24 | hash = hash ^ x.hashValue 25 | } 26 | return hash 27 | } 28 | } 29 | } 30 | 31 | open class ErrorMessage:Hashable { 32 | open var compact:String 33 | open var extended:String 34 | 35 | init() { 36 | self.compact = "" 37 | self.extended = "" 38 | } 39 | 40 | open var hashValue: Int { 41 | get { 42 | return self.compact.hash ^ self.extended.hash 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Pod/Classes/Core/FailMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FailMessage.swift 3 | // TestValidator 4 | // 5 | // Created by FrogRain on 31/01/16. 6 | // Copyright © 2016 FrogRain. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | open class FailMessage : NSObject { 12 | 13 | open var summary:ErrorMessage 14 | open var localizedSubject:String? 15 | 16 | open var errors:Array 17 | 18 | fileprivate var opaqueDict:Dictionary 19 | 20 | override init() { 21 | self.summary = ErrorMessage() 22 | self.errors = Array() 23 | self.opaqueDict = Dictionary() 24 | super.init() 25 | } 26 | 27 | open func failingFields () -> [String] { 28 | return self.opaqueDict.keys.map { (key) -> String in 29 | key 30 | } 31 | } 32 | 33 | func setObject(_ object:FailMessage, forKey:String) { 34 | self.opaqueDict[forKey] = object; 35 | } 36 | 37 | override open func value(forKeyPath keyPath: String) -> Any? { 38 | let dict = self.opaqueDict as NSDictionary 39 | return dict.value(forKeyPath: keyPath) as? FailMessage 40 | } 41 | 42 | open func failMessageForPath(_ keyPath: String) -> FailMessage? { 43 | return self.value(forKeyPath: keyPath) as? FailMessage 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Pod/Classes/Core/LocalizationHelper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LocalizationHelper.swift 3 | // TestValidator 4 | // 5 | // Created by FrogRain on 31/01/16. 6 | // Copyright © 2016 FrogRain. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class LocalizationHelper { 12 | class func localizeThis(_ key:String) -> String { 13 | let mainBundle = Bundle.main 14 | var localizedString = NSLocalizedString(key, tableName: "object_validator_custom", bundle: mainBundle, comment:"") 15 | if(localizedString != key) { 16 | return localizedString 17 | } 18 | 19 | guard let frameworkPath = Bundle(for: LocalizationHelper.self).resourcePath else { 20 | return key 21 | } 22 | guard let path = URL(string: frameworkPath)?.appendingPathComponent("FluidValidator.bundle").path else { 23 | return key 24 | } 25 | guard let bundle = Bundle(path: path) else { 26 | return key 27 | } 28 | 29 | localizedString = NSLocalizedString(key, tableName: "object_validator", bundle: bundle, comment:"") 30 | 31 | if(localizedString != key) { 32 | return localizedString 33 | } 34 | 35 | return key 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Pod/Classes/Core/Validatable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Validatable.swift 3 | // TestValidator 4 | // 5 | // Created by FrogRain on 31/01/16. 6 | // Copyright © 2016 FrogRain. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public protocol Validatable { 12 | var overrideErrorMessage:String? {get set} 13 | var overrideErrorMessageExtended:String? {get set} 14 | 15 | func performValidation(onObject object:AnyObject?) -> Bool 16 | 17 | func hydrateError(withFailMessage message:FailMessage, localizedSubject:String, failValue:AnyObject?, context:AnyObject) -> () 18 | } 19 | -------------------------------------------------------------------------------- /Pod/Classes/Core/Validation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Validation.swift 3 | // TestValidator 4 | // 5 | // Created by FrogRain on 31/01/16. 6 | // Copyright © 2016 FrogRain. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | open class Validation { 12 | 13 | var validatables:Array = Array() 14 | var error:FailMessage = FailMessage() 15 | var validationName:String 16 | 17 | var whenCondition:((_ context:T) -> (Bool))? 18 | var targetGetter:(_ context:T)->(Any?) 19 | 20 | 21 | public init(name:String, targetGetter:@escaping (_ context:T)->(Any?)){ 22 | self.validationName = name 23 | self.validatables = Array() 24 | self.error = FailMessage() 25 | self.targetGetter = targetGetter 26 | } 27 | 28 | open func runValidation(_ object:T) -> Bool { 29 | self.error = FailMessage() 30 | 31 | for validatable in self.validatables { 32 | let target = self.targetGetter(object) as AnyObject? 33 | 34 | if let whenCondition = self.whenCondition , !whenCondition(object) { 35 | return true 36 | } 37 | 38 | if(!validatable.performValidation(onObject: target)) { 39 | let localizedName = self.localizeValidationName(self.validationName, context:object) 40 | 41 | validatable.hydrateError(withFailMessage: self.error, localizedSubject: localizedName, failValue: target, context: object) 42 | return false 43 | } 44 | } 45 | return true 46 | } 47 | 48 | @discardableResult open func addRule(_ validatable:Validatable) -> Self { 49 | self.validatables.append(validatable) 50 | return self 51 | } 52 | 53 | @discardableResult open func when(_ condition:@escaping (_ context:T) -> (Bool)) -> Self { 54 | self.whenCondition = condition 55 | return self 56 | } 57 | 58 | open var allErrors: FailMessage { 59 | return self.error 60 | } 61 | 62 | open func localizeValidationName(_ name:String, context:T) -> String { 63 | let className = String(describing: T.self) 64 | let key = String(format: "%@.%@.error.name", className, name) 65 | return LocalizationHelper.localizeThis(key) 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Pod/Classes/Core/ValidationBase.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ValidationBase.swift 3 | // TestValidator 4 | // 5 | // Created by FrogRain on 04/02/16. 6 | // Copyright © 2016 FrogRain. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | open class ValidationBase : Validatable { 12 | open var overrideErrorMessage:String? 13 | open var overrideErrorMessageExtended:String? 14 | 15 | public init() {} 16 | 17 | open func performValidation(onObject object:AnyObject?) -> Bool { 18 | fatalError("Not implemented error") 19 | } 20 | 21 | open func hydrateError(withFailMessage message: FailMessage, localizedSubject: String, failValue: AnyObject?, context: AnyObject) { 22 | fatalError("Not implemented error") 23 | } 24 | 25 | func optionalValueDescription(_ value:AnyObject?) -> String { 26 | var valueString = ""; 27 | if let value = value { 28 | valueString = value.description 29 | }else{ 30 | valueString = "nil" 31 | } 32 | return valueString 33 | } 34 | 35 | func errorMessage(_ subject:String, failValue: AnyObject?, context: AnyObject) -> String { 36 | var message = self.errorTextLocalized() 37 | if let overrideMessage = self.overrideErrorMessage { 38 | message = overrideMessage 39 | } 40 | return String(format: message, subject, self.optionalValueDescription(failValue)) 41 | } 42 | 43 | func errorTextLocalized() -> String { 44 | let className = String(describing: type(of: self).self) 45 | let key = String(format: "%@.error.message", className) 46 | return LocalizationHelper.localizeThis(key) 47 | } 48 | 49 | func errorMessageExtended(_ subject:String, failValue: AnyObject?, context: AnyObject) -> String { 50 | var message = self.errorTextExtendedLocalized() 51 | if let overrideMessage = self.overrideErrorMessage { 52 | message = overrideMessage 53 | } 54 | return String(format: message, subject, self.optionalValueDescription(failValue)) 55 | } 56 | 57 | func errorTextExtendedLocalized() -> String { 58 | let className = String(describing: type(of: self).self) 59 | let key = String(format: "%@.error.message.extended", className) 60 | return LocalizationHelper.localizeThis(key) 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Pod/Classes/Validators/BeNotEmpty.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BeNotEmpty.swift 3 | // Pods 4 | // 5 | // Created by FrogRain on 06/02/16. 6 | // 7 | // 8 | 9 | import Foundation 10 | fileprivate func < (lhs: T?, rhs: T?) -> Bool { 11 | switch (lhs, rhs) { 12 | case let (l?, r?): 13 | return l < r 14 | case (nil, _?): 15 | return true 16 | default: 17 | return false 18 | } 19 | } 20 | 21 | fileprivate func > (lhs: T?, rhs: T?) -> Bool { 22 | switch (lhs, rhs) { 23 | case let (l?, r?): 24 | return l > r 25 | default: 26 | return rhs < lhs 27 | } 28 | } 29 | 30 | 31 | open class BeNotEmpty : BeNotNil { 32 | override open func performValidation(onObject object: AnyObject?) -> Bool { 33 | if (!super.performValidation(onObject: object)) { 34 | return false 35 | } 36 | return object?.description.characters.count > 0 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Pod/Classes/Validators/BeNotNil.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // TestValidator 4 | // 5 | // Created by FrogRain on 05/02/16. 6 | // Copyright © 2016 FrogRain. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | open class BeNotNil : AbstractValidationRule { 12 | 13 | override open func performValidation(onObject object: AnyObject?) -> Bool { 14 | return object != nil 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Pod/Classes/Validators/BeTrue.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BeTrue.swift 3 | // Pods 4 | // 5 | // Created by FrogRain on 06/02/16. 6 | // 7 | // 8 | 9 | import Foundation 10 | 11 | open class BeTrue : BeNotNil { 12 | 13 | override open func performValidation(onObject object: AnyObject?) -> Bool { 14 | if(!super.performValidation(onObject: object)){ 15 | return false 16 | } 17 | return object as? Bool ?? false 18 | } 19 | 20 | override func optionalValueDescription(_ value: AnyObject?) -> String { 21 | let valueDescription = value as? Bool ?? false 22 | return valueDescription ? "active" : "not active" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Pod/Classes/Validators/GenericRule.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GenericRule.swift 3 | // Pods 4 | // 5 | // Created by FrogRain on 06/02/16. 6 | // 7 | // 8 | 9 | import Foundation 10 | 11 | open class GenericRule: BeNotNil { 12 | fileprivate var genericCondition:(AnyObject) -> (Bool) 13 | 14 | public init(condition:@escaping (AnyObject) -> (Bool)) { 15 | self.genericCondition = condition 16 | super.init() 17 | } 18 | 19 | override open func performValidation(onObject object: AnyObject?) -> Bool { 20 | if(!super.performValidation(onObject: object)) { 21 | return false 22 | } 23 | guard let object = object else { 24 | return false 25 | } 26 | return self.genericCondition(object) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Pod/Classes/Validators/GreaterThan.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GreaterThan.swift 3 | // Pods 4 | // 5 | // Created by FrogRain on 06/02/16. 6 | // 7 | // 8 | 9 | import Foundation 10 | 11 | open class GreaterThan : BeNotNil { 12 | fileprivate var limit:NSNumber 13 | fileprivate var includeLimit:Bool 14 | 15 | public init(limit: NSNumber, includeLimit:Bool?) { 16 | self.limit = limit 17 | if let include = includeLimit { 18 | self.includeLimit = include 19 | }else{ 20 | self.includeLimit = false 21 | } 22 | super.init() 23 | } 24 | 25 | override open func performValidation(onObject object: AnyObject?) -> Bool { 26 | if(!super.performValidation(onObject: object)) { 27 | return false 28 | }else{ 29 | guard let value = object as? NSNumber else { 30 | return false 31 | } 32 | var result = value.compare(self.limit) == .orderedDescending 33 | if(self.includeLimit){ 34 | result = result || (value == self.limit) 35 | } 36 | return result 37 | } 38 | } 39 | 40 | override func errorMessage(_ subject: String, failValue: AnyObject?, context: AnyObject) -> String { 41 | let errMessage = self.errorTextLocalized() 42 | return String(format: errMessage, self.limit) 43 | } 44 | 45 | override func errorMessageExtended(_ subject: String, failValue: AnyObject?, context: AnyObject) -> String { 46 | let errMessage = self.errorTextExtendedLocalized() 47 | return String(format: errMessage, subject, self.limit, self.optionalValueDescription(failValue)) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Pod/Classes/Validators/InRange.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InRange.swift 3 | // Pods 4 | // 5 | // Created by FrogRain on 06/02/16. 6 | // 7 | // 8 | 9 | import Foundation 10 | 11 | open class InRange : BeNotNil { 12 | fileprivate var min:NSNumber 13 | fileprivate var max:NSNumber 14 | fileprivate var comparisonMode:ComparisonMode = ComparisonMode.MinMaxExluded 15 | 16 | public init(min:NSNumber, max:NSNumber, mode:ComparisonMode) { 17 | self.min = min 18 | self.max = max 19 | self.comparisonMode = mode 20 | super.init() 21 | } 22 | 23 | override open func performValidation(onObject object: AnyObject?) -> Bool { 24 | if (!super.performValidation(onObject: object)) { 25 | return false 26 | } 27 | guard let value = object as? NSNumber else { 28 | return false 29 | } 30 | 31 | var lowerLimit = value.compare(min) == .orderedDescending 32 | if(self.comparisonMode.contains(ComparisonMode.MinIncluded)) { 33 | lowerLimit = lowerLimit || value.compare(min) == .orderedSame 34 | } 35 | 36 | var higherLimit = value.compare(max) == .orderedAscending 37 | if(self.comparisonMode.contains(ComparisonMode.MaxIncluded)) { 38 | higherLimit = higherLimit || value.compare(max) == .orderedSame 39 | } 40 | 41 | return lowerLimit && higherLimit 42 | } 43 | 44 | override func errorMessage(_ subject: String, failValue: AnyObject?, context: AnyObject) -> String { 45 | let errMessage = self.errorTextLocalized() 46 | return String(format: errMessage, self.min, self.max) 47 | } 48 | 49 | override func errorMessageExtended(_ subject: String, failValue: AnyObject?, context: AnyObject) -> String { 50 | let errMessage = self.errorTextExtendedLocalized() 51 | return String(format: errMessage, subject, self.min, self.max, self.optionalValueDescription(failValue)) 52 | } 53 | } 54 | 55 | public struct ComparisonMode : OptionSet{ 56 | public let rawValue : Int 57 | public init(rawValue:Int){ self.rawValue = rawValue} 58 | 59 | public static let MinMaxExluded = ComparisonMode(rawValue:1) 60 | public static let MinIncluded = ComparisonMode(rawValue:2) 61 | public static let MaxIncluded = ComparisonMode(rawValue:4) 62 | } 63 | -------------------------------------------------------------------------------- /Pod/Classes/Validators/LessThan.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LessThan.swift 3 | // Pods 4 | // 5 | // Created by FrogRain on 06/02/16. 6 | // 7 | // 8 | 9 | import Foundation 10 | 11 | open class LessThan : BeNotNil { 12 | fileprivate var limit:NSNumber 13 | fileprivate var includeLimit:Bool 14 | 15 | public init(limit: NSNumber, includeLimit include:Bool = false) { 16 | self.limit = limit 17 | self.includeLimit = include 18 | super.init() 19 | } 20 | 21 | override open func performValidation(onObject object: AnyObject?) -> Bool { 22 | if(!super.performValidation(onObject: object)) { 23 | return false 24 | }else{ 25 | guard let value = object as? NSNumber else { 26 | return false 27 | } 28 | var result = value.compare(self.limit) == .orderedAscending 29 | if(self.includeLimit){ 30 | result = result || (value == self.limit) 31 | } 32 | return result 33 | } 34 | } 35 | 36 | override func errorMessage(_ subject: String, failValue: AnyObject?, context: AnyObject) -> String { 37 | let errMessage = self.errorTextLocalized() 38 | return String(format: errMessage, subject, self.limit, self.optionalValueDescription(failValue)) 39 | } 40 | 41 | override func errorMessageExtended(_ subject: String, failValue: AnyObject?, context: AnyObject) -> String { 42 | let errMessage = self.errorTextExtendedLocalized() 43 | return String(format: errMessage, subject, self.limit, self.optionalValueDescription(failValue)) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Pod/Classes/Validators/RegexMatch.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RegexMatch.swift 3 | // Pods 4 | // 5 | // Created by FrogRain on 06/02/16. 6 | // 7 | // 8 | 9 | import Foundation 10 | 11 | open class RegexMatch: BeNotEmpty { 12 | fileprivate var regex:String 13 | 14 | public init(regex:String) { 15 | self.regex = regex 16 | super.init() 17 | } 18 | 19 | override open func performValidation(onObject object: AnyObject?) -> Bool { 20 | if(!super.performValidation(onObject: object)) { 21 | return false 22 | } 23 | 24 | let test = NSPredicate(format: "SELF MATCHES %@", self.regex) 25 | return test.evaluate(with: object) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Pod/Classes/Validators/ValidEmail.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ValidEmail.swift 3 | // Pods 4 | // 5 | // Created by FrogRain on 06/02/16. 6 | // 7 | // 8 | 9 | import Foundation 10 | 11 | open class ValidEmail: RegexMatch { 12 | public init() { 13 | let regex = "^[A-Za-z0-9+_.-]+@[A-Za-z0-9.-]+$" 14 | super.init(regex: regex) 15 | } 16 | 17 | override open func performValidation(onObject object: AnyObject?) -> Bool { 18 | return super.performValidation(onObject: object) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Pod/FluidValidator.bundle/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digiacomo/FluidValidator/d4a164d45245d2eac7967295f87890ae80e93246/Pod/FluidValidator.bundle/.gitkeep -------------------------------------------------------------------------------- /Pod/FluidValidator.bundle/en.lproj/object_validator.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digiacomo/FluidValidator/d4a164d45245d2eac7967295f87890ae80e93246/Pod/FluidValidator.bundle/en.lproj/object_validator.strings -------------------------------------------------------------------------------- /Pod/FluidValidator.bundle/it.lproj/object_validator.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digiacomo/FluidValidator/d4a164d45245d2eac7967295f87890ae80e93246/Pod/FluidValidator.bundle/it.lproj/object_validator.strings -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FluidValidator 2 | 3 | [![CI Status](http://img.shields.io/travis/FrogRain/FluidValidator.svg?style=flat)](https://travis-ci.org/FrogRain/FluidValidator) 4 | [![Version](https://img.shields.io/cocoapods/v/FluidValidator.svg?style=flat)](http://cocoapods.org/pods/FluidValidator) 5 | [![License](https://img.shields.io/cocoapods/l/FluidValidator.svg?style=flat)](http://cocoapods.org/pods/FluidValidator) 6 | [![Platform](https://img.shields.io/cocoapods/p/FluidValidator.svg?style=flat)](http://cocoapods.org/pods/FluidValidator) 7 | 8 | ## Description 9 | FluidValidator is intended to encapsulate validation logic. The API was designed with FluentValidation (https://github.com/JeremySkinner/FluentValidation) and Rails Validation as reference. 10 | Currently offers validation of simple objects, complex objects (object graph), enumerables. Localized error messages. You can easly override base behaviors and/or build your own reusable validation rules. 11 | 12 | ## Usage 13 | 14 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 15 | 16 | ## Requirements 17 | No special requirements 18 | 19 | ## Installation 20 | 21 | FluidValidator is available through [CocoaPods](http://cocoapods.org). To install 22 | it, simply add the following line to your Podfile: 23 | 24 | ```ruby 25 | pod "FluidValidator" 26 | ``` 27 | 28 | ## Usage 29 | ### A simple object 30 | Given this object: 31 | 32 | ```swift 33 | 34 | import Foundation 35 | 36 | class Home { 37 | var isLocked:Bool? 38 | var number:Int? 39 | var ownerName:String? 40 | } 41 | ``` 42 | 43 | Create a custom validator extending AbstractValidator specifing target class Example: 44 | 45 | ```swift 46 | 47 | import Foundation 48 | import FluidValidator 49 | 50 | class HomeValidator : AbstractValidator { 51 | override init() { 52 | super.init() 53 | 54 | self.addValidation(withName: "number") { (context) -> (Any?) in 55 | context.number 56 | }.addRule(GreaterThan(limit: 3, includeLimit: false)) 57 | 58 | self.addValidation(withName: "ownerName") { (context) -> (Any?) in 59 | context.ownerName 60 | }.addRule(BeNotEmpty()) 61 | 62 | self.addValidation(withName: "isLocked") { (context) -> (Any?) in 63 | context.isLocked 64 | }.addRule(BeTrue()) 65 | } 66 | } 67 | ``` 68 | ### Nested Objects 69 | Given this more complex object: 70 | ```swift 71 | import Foundation 72 | 73 | class Home { 74 | var isLocked:Bool? 75 | var number:Int? 76 | var ownerName:String? 77 | var garage: Garage? 78 | } 79 | class Garage { 80 | var isOpen: Bool? 81 | var maxCars: Int? 82 | } 83 | ``` 84 | The corresponding validator would be implemented this way: 85 | ```swift 86 | import Foundation 87 | import FluidValidator 88 | 89 | class GarageValidator: AbstractValidator { 90 | override init() { 91 | super.init() 92 | 93 | self.addValidation(withName: "isOpen") { (context) -> Any? in 94 | context.isOpen 95 | }.addRule(BeTrue()) 96 | 97 | self.addValidation(withName: "maxCars") { (context) -> Any? in 98 | context.maxCars 99 | }.addRule(LessThan(limit: 2, includeLimit: true)) 100 | } 101 | } 102 | 103 | class HomeValidator : AbstractValidator { 104 | override init() { 105 | super.init() 106 | 107 | ... 108 | self.addValidation(withName: "garage") { (context) -> (Any?) in 109 | context.garage 110 | }.addRule(GarageValidator()) 111 | } 112 | } 113 | ``` 114 | 115 | ### Run validations and get result 116 | 117 | regardless of your validators complexity, you can run validation process and extract error messages (if any) as showed here 118 | 119 | ```swift 120 | 121 | let garage = Garage() 122 | garage.isOpen = false 123 | 124 | let home = Home() 125 | home.isLocked = true 126 | home.ownerName = "John Doe" 127 | home.number = 2 128 | home.garage = garage 129 | 130 | let homeValidator = HomeValidator() 131 | let result = homeValidator.validate(home) 132 | let failMessage = homeValidator.allErrors() 133 | ``` 134 | 135 | ### Get fail messages 136 | ```swift 137 | failMessage.failMessageForPath("number")?.errors.first?.compact 138 | failMessage.failMessageForPath("number")?.errors.first?.extended 139 | 140 | failMessage.failMessageForPath("garage")?.errors.first?.compact 141 | failMessage.failMessageForPath("garage.isOpen")?.errors.first?.extended 142 | ``` 143 | The errors array contains ErrorMessage objects which in turn contains compact and extended error message. 144 | 145 | Take a look at Unit Test classes to figure out other features 146 | 147 | 148 | 149 | ## Author 150 | 151 | FrogRain, info@frograin.com 152 | 153 | ## License 154 | 155 | FluidValidator is available under the MIT license. See the LICENSE file for more info. 156 | -------------------------------------------------------------------------------- /_FluidValidatorFramework.xcodeproj: -------------------------------------------------------------------------------- 1 | Framework/Framework.xcodeproj -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj --------------------------------------------------------------------------------