├── .gitignore ├── .swift-version ├── .travis.yml ├── Demo ├── Carthage │ └── Cartfile ├── Podfile ├── Podfile.lock ├── Pods │ ├── Headers │ │ └── Private │ │ │ └── XLForm │ │ │ ├── NSArray+XLFormAdditions.h │ │ │ ├── NSExpression+XLFormAdditions.h │ │ │ ├── NSObject+XLFormAdditions.h │ │ │ ├── NSPredicate+XLFormAdditions.h │ │ │ ├── NSString+XLFormAdditions.h │ │ │ ├── UIView+XLFormAdditions.h │ │ │ ├── XLForm.h │ │ │ ├── XLFormBaseCell.h │ │ │ ├── XLFormButtonCell.h │ │ │ ├── XLFormCheckCell.h │ │ │ ├── XLFormDateCell.h │ │ │ ├── XLFormDatePickerCell.h │ │ │ ├── XLFormDescriptor.h │ │ │ ├── XLFormDescriptorCell.h │ │ │ ├── XLFormDescriptorDelegate.h │ │ │ ├── XLFormImageCell.h │ │ │ ├── XLFormInlineRowDescriptorCell.h │ │ │ ├── XLFormInlineSelectorCell.h │ │ │ ├── XLFormLeftRightSelectorCell.h │ │ │ ├── XLFormOptionsObject.h │ │ │ ├── XLFormOptionsViewController.h │ │ │ ├── XLFormPickerCell.h │ │ │ ├── XLFormRegexValidator.h │ │ │ ├── XLFormRightDetailCell.h │ │ │ ├── XLFormRightImageButton.h │ │ │ ├── XLFormRowDescriptor.h │ │ │ ├── XLFormRowDescriptorViewController.h │ │ │ ├── XLFormRowNavigationAccessoryView.h │ │ │ ├── XLFormSectionDescriptor.h │ │ │ ├── XLFormSegmentedCell.h │ │ │ ├── XLFormSelectorCell.h │ │ │ ├── XLFormSliderCell.h │ │ │ ├── XLFormStepCounterCell.h │ │ │ ├── XLFormSwitchCell.h │ │ │ ├── XLFormTextFieldCell.h │ │ │ ├── XLFormTextView.h │ │ │ ├── XLFormTextViewCell.h │ │ │ ├── XLFormValidationStatus.h │ │ │ ├── XLFormValidator.h │ │ │ ├── XLFormValidatorProtocol.h │ │ │ └── XLFormViewController.h │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ ├── project.pbxproj │ │ └── xcuserdata │ │ │ └── dmitry.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── Pods.xcscheme │ │ │ ├── XLForm.xcscheme │ │ │ └── xcschememanagement.plist │ ├── ScalePicker │ │ ├── LICENSE │ │ ├── README.md │ │ └── ScalePicker │ │ │ ├── ScalePicker.swift │ │ │ ├── SlidePicker.swift │ │ │ └── SlidePickerFlowLayout.swift │ ├── Target Support Files │ │ ├── Pods │ │ │ ├── Info.plist │ │ │ ├── Pods-acknowledgements.markdown │ │ │ ├── Pods-acknowledgements.plist │ │ │ ├── Pods-dummy.m │ │ │ ├── Pods-frameworks.sh │ │ │ ├── Pods-resources.sh │ │ │ ├── Pods-umbrella.h │ │ │ ├── Pods.debug.xcconfig │ │ │ ├── Pods.modulemap │ │ │ └── Pods.release.xcconfig │ │ └── XLForm │ │ │ ├── Info.plist │ │ │ ├── XLForm-dummy.m │ │ │ ├── XLForm-prefix.pch │ │ │ ├── XLForm-umbrella.h │ │ │ ├── XLForm.modulemap │ │ │ └── XLForm.xcconfig │ └── XLForm │ │ ├── LICENSE │ │ ├── README.md │ │ └── XLForm │ │ ├── XL │ │ ├── Cell │ │ │ ├── XLFormBaseCell.h │ │ │ ├── XLFormBaseCell.m │ │ │ ├── XLFormButtonCell.h │ │ │ ├── XLFormButtonCell.m │ │ │ ├── XLFormCheckCell.h │ │ │ ├── XLFormCheckCell.m │ │ │ ├── XLFormDateCell.h │ │ │ ├── XLFormDateCell.m │ │ │ ├── XLFormDatePickerCell.h │ │ │ ├── XLFormDatePickerCell.m │ │ │ ├── XLFormDescriptorCell.h │ │ │ ├── XLFormImageCell.h │ │ │ ├── XLFormImageCell.m │ │ │ ├── XLFormInlineRowDescriptorCell.h │ │ │ ├── XLFormInlineSelectorCell.h │ │ │ ├── XLFormInlineSelectorCell.m │ │ │ ├── XLFormLeftRightSelectorCell.h │ │ │ ├── XLFormLeftRightSelectorCell.m │ │ │ ├── XLFormPickerCell.h │ │ │ ├── XLFormPickerCell.m │ │ │ ├── XLFormSegmentedCell.h │ │ │ ├── XLFormSegmentedCell.m │ │ │ ├── XLFormSelectorCell.h │ │ │ ├── XLFormSelectorCell.m │ │ │ ├── XLFormSliderCell.h │ │ │ ├── XLFormSliderCell.m │ │ │ ├── XLFormStepCounterCell.h │ │ │ ├── XLFormStepCounterCell.m │ │ │ ├── XLFormSwitchCell.h │ │ │ ├── XLFormSwitchCell.m │ │ │ ├── XLFormTextFieldCell.h │ │ │ ├── XLFormTextFieldCell.m │ │ │ ├── XLFormTextViewCell.h │ │ │ └── XLFormTextViewCell.m │ │ ├── Controllers │ │ │ ├── XLFormOptionsObject.h │ │ │ ├── XLFormOptionsObject.m │ │ │ ├── XLFormOptionsViewController.h │ │ │ ├── XLFormOptionsViewController.m │ │ │ ├── XLFormRowDescriptorViewController.h │ │ │ ├── XLFormViewController.h │ │ │ └── XLFormViewController.m │ │ ├── Descriptors │ │ │ ├── XLFormDescriptor.h │ │ │ ├── XLFormDescriptor.m │ │ │ ├── XLFormDescriptorDelegate.h │ │ │ ├── XLFormRowDescriptor.h │ │ │ ├── XLFormRowDescriptor.m │ │ │ ├── XLFormSectionDescriptor.h │ │ │ └── XLFormSectionDescriptor.m │ │ ├── Helpers │ │ │ ├── NSArray+XLFormAdditions.h │ │ │ ├── NSArray+XLFormAdditions.m │ │ │ ├── NSExpression+XLFormAdditions.h │ │ │ ├── NSExpression+XLFormAdditions.m │ │ │ ├── NSObject+XLFormAdditions.h │ │ │ ├── NSObject+XLFormAdditions.m │ │ │ ├── NSPredicate+XLFormAdditions.h │ │ │ ├── NSPredicate+XLFormAdditions.m │ │ │ ├── NSString+XLFormAdditions.h │ │ │ ├── NSString+XLFormAdditions.m │ │ │ ├── UIView+XLFormAdditions.h │ │ │ ├── UIView+XLFormAdditions.m │ │ │ └── Views │ │ │ │ ├── XLFormRightDetailCell.h │ │ │ │ ├── XLFormRightDetailCell.m │ │ │ │ ├── XLFormRightImageButton.h │ │ │ │ ├── XLFormRightImageButton.m │ │ │ │ ├── XLFormRowNavigationAccessoryView.h │ │ │ │ ├── XLFormRowNavigationAccessoryView.m │ │ │ │ ├── XLFormTextView.h │ │ │ │ └── XLFormTextView.m │ │ ├── Validation │ │ │ ├── XLFormRegexValidator.h │ │ │ ├── XLFormRegexValidator.m │ │ │ ├── XLFormValidationStatus.h │ │ │ ├── XLFormValidationStatus.m │ │ │ ├── XLFormValidator.h │ │ │ ├── XLFormValidator.m │ │ │ └── XLFormValidatorProtocol.h │ │ ├── XLForm.h │ │ └── XLForm.m │ │ └── XLForm.bundle │ │ └── forwardarrow@2x.png ├── ScalePicker │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── arrowPointer.imageset │ │ │ ├── Contents.json │ │ │ ├── arrow_pointer@2x.png │ │ │ └── arrow_pointer@3x.png │ │ ├── speedAuto.imageset │ │ │ ├── Contents.json │ │ │ ├── shutter_speed_auto_normal@2x.png │ │ │ └── shutter_speed_auto_normal@3x.png │ │ └── speedManual.imageset │ │ │ ├── Contents.json │ │ │ ├── shutter_speed_manual_normal@2x.png │ │ │ └── shutter_speed_manual_normal@3x.png │ ├── Base.lproj │ │ └── LaunchScreen.storyboard │ ├── DemoView.xib │ ├── Info.plist │ ├── ScalePicker-Bridging-Header.h │ ├── Utils.swift │ └── ViewController.swift ├── ScalePickerDemo.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── ScalePickerDemo.xcworkspace │ └── contents.xcworkspacedata ├── LICENSE ├── README.md ├── ScalePicker.podspec ├── ScalePicker.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ └── ScalePicker.xcscheme ├── ScalePicker ├── Info.plist ├── ScalePicker.h ├── ScalePicker.swift ├── SlidePicker.swift └── SlidePickerFlowLayout.swift └── Screenshots ├── 1.jpg ├── 1.png ├── 2.png ├── 3.png └── demo.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | Pods/ 27 | 28 | ### 29 | ._* 30 | 31 | .hgignore 32 | 33 | .DS_Store 34 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 2.1 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | 3 | branches: 4 | only: 5 | - master 6 | 7 | xcode_project: ScalePicker.xcodeproj 8 | xcode_scheme: ScalePicker 9 | osx_image: xcode7.3 10 | xcode_sdk: iphonesimulator9.3 11 | 12 | script: 13 | - xcodebuild build -project ScalePicker.xcodeproj -scheme "ScalePicker" -destination "platform=iOS Simulator,name=iPhone 6s" 14 | -------------------------------------------------------------------------------- /Demo/Carthage/Cartfile: -------------------------------------------------------------------------------- 1 | github "kronik/ScalePicker" 2 | -------------------------------------------------------------------------------- /Demo/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | 3 | platform :ios, '8.0' 4 | use_frameworks! 5 | 6 | pod 'XLForm' 7 | pod 'ScalePicker' 8 | 9 | -------------------------------------------------------------------------------- /Demo/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - ScalePicker (1.1.1) 3 | - XLForm (3.1.1) 4 | 5 | DEPENDENCIES: 6 | - ScalePicker 7 | - XLForm 8 | 9 | SPEC CHECKSUMS: 10 | ScalePicker: 5f3a1fd03e94eea412ed674491881f78ae9cd356 11 | XLForm: c9ee7e0f859341279bfd894f9589a9d25c23e4df 12 | 13 | COCOAPODS: 0.39.0 14 | -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/NSArray+XLFormAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Helpers/NSArray+XLFormAdditions.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/NSExpression+XLFormAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Helpers/NSExpression+XLFormAdditions.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/NSObject+XLFormAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Helpers/NSObject+XLFormAdditions.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/NSPredicate+XLFormAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Helpers/NSPredicate+XLFormAdditions.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/NSString+XLFormAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Helpers/NSString+XLFormAdditions.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/UIView+XLFormAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Helpers/UIView+XLFormAdditions.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLForm.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/XLForm.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormBaseCell.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Cell/XLFormBaseCell.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormButtonCell.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Cell/XLFormButtonCell.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormCheckCell.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Cell/XLFormCheckCell.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormDateCell.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Cell/XLFormDateCell.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormDatePickerCell.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Cell/XLFormDatePickerCell.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormDescriptor.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Descriptors/XLFormDescriptor.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormDescriptorCell.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Cell/XLFormDescriptorCell.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormDescriptorDelegate.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Descriptors/XLFormDescriptorDelegate.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormImageCell.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Cell/XLFormImageCell.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormInlineRowDescriptorCell.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Cell/XLFormInlineRowDescriptorCell.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormInlineSelectorCell.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Cell/XLFormInlineSelectorCell.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormLeftRightSelectorCell.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Cell/XLFormLeftRightSelectorCell.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormOptionsObject.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Controllers/XLFormOptionsObject.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormOptionsViewController.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Controllers/XLFormOptionsViewController.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormPickerCell.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Cell/XLFormPickerCell.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormRegexValidator.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Validation/XLFormRegexValidator.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormRightDetailCell.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Helpers/Views/XLFormRightDetailCell.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormRightImageButton.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Helpers/Views/XLFormRightImageButton.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormRowDescriptor.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Descriptors/XLFormRowDescriptor.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormRowDescriptorViewController.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Controllers/XLFormRowDescriptorViewController.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormRowNavigationAccessoryView.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Helpers/Views/XLFormRowNavigationAccessoryView.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormSectionDescriptor.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Descriptors/XLFormSectionDescriptor.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormSegmentedCell.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Cell/XLFormSegmentedCell.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormSelectorCell.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Cell/XLFormSelectorCell.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormSliderCell.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Cell/XLFormSliderCell.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormStepCounterCell.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Cell/XLFormStepCounterCell.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormSwitchCell.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Cell/XLFormSwitchCell.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormTextFieldCell.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Cell/XLFormTextFieldCell.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormTextView.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Helpers/Views/XLFormTextView.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormTextViewCell.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Cell/XLFormTextViewCell.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormValidationStatus.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Validation/XLFormValidationStatus.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormValidator.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Validation/XLFormValidator.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormValidatorProtocol.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Validation/XLFormValidatorProtocol.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/XLForm/XLFormViewController.h: -------------------------------------------------------------------------------- 1 | ../../../XLForm/XLForm/XL/Controllers/XLFormViewController.h -------------------------------------------------------------------------------- /Demo/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - ScalePicker (1.1.1) 3 | - XLForm (3.1.1) 4 | 5 | DEPENDENCIES: 6 | - ScalePicker 7 | - XLForm 8 | 9 | SPEC CHECKSUMS: 10 | ScalePicker: 5f3a1fd03e94eea412ed674491881f78ae9cd356 11 | XLForm: c9ee7e0f859341279bfd894f9589a9d25c23e4df 12 | 13 | COCOAPODS: 0.39.0 14 | -------------------------------------------------------------------------------- /Demo/Pods/Pods.xcodeproj/xcuserdata/dmitry.xcuserdatad/xcschemes/Pods.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Demo/Pods/Pods.xcodeproj/xcuserdata/dmitry.xcuserdatad/xcschemes/XLForm.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Demo/Pods/Pods.xcodeproj/xcuserdata/dmitry.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Pods.xcscheme 8 | 9 | isShown 10 | 11 | 12 | ScalePicker.xcscheme 13 | 14 | isShown 15 | 16 | 17 | XLForm.xcscheme 18 | 19 | isShown 20 | 21 | 22 | 23 | SuppressBuildableAutocreation 24 | 25 | 6E156E9A4282E9313FD526D02F0716A7 26 | 27 | primary 28 | 29 | 30 | D714F76170B4AB35C54A9F22408E6508 31 | 32 | primary 33 | 34 | 35 | DA955EB5F9E55083270B887E898787C1 36 | 37 | primary 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Demo/Pods/ScalePicker/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Dmitry Klimkin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Demo/Pods/ScalePicker/README.md: -------------------------------------------------------------------------------- 1 |

2 | Platform: iOS 8+ 3 | 4 | Language: Swift 2 5 | Carthage compatible 6 | License: MIT 7 |

8 | 9 | # ScalePicker 10 | 11 | Generic scale and a handy float-value picker for any iOS app. 12 | 13 | ## Preview 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | ## Installation 23 | 24 | ### With source code 25 | 26 | [Download repository](https://github.com/kronik/ScalePicker/archive/master.zip), then add [ScalePicker directory](https://github.com/kronik/ScalePicker/blob/master/ScalePicker/) to your project. 27 | 28 | ### With CocoaPods 29 | 30 | CocoaPods is a dependency manager for Objective-C/Swift, which automates and simplifies the process of using 3rd-party libraries in your projects. To install with cocoaPods, follow the "Get Started" section on [CocoaPods](https://cocoapods.org/). 31 | 32 | #### Podfile 33 | ```ruby 34 | platform :ios, '8.0' 35 | use_frameworks! 36 | 37 | pod 'ScalePicker', '~> 1.1.1' 38 | ``` 39 | 40 | ### With Carthage 41 | 42 | Carthage is a lightweight dependency manager for Swift and Objective-C. It leverages CocoaTouch modules and is less invasive than CocoaPods. To install with carthage, follow the instruction on [Carthage](https://github.com/Carthage/Carthage/). 43 | 44 | #### Cartfile 45 | ``` 46 | github "kronik/ScalePicker" ~> 1.1.1 47 | ``` 48 | 49 | ## Usage 50 | 51 | ### Initialisation 52 | 53 | Instantiate scale view with preferred frame: 54 | 55 | ```swift 56 | let screenWidth = UIScreen.mainScreen().bounds.size.width 57 | let scaleView = ScalePicker(frame: CGRectMake(0, 0, screenWidth, 50)) 58 | 59 | view.addSubview(scaleView) 60 | ``` 61 | 62 | ### Properties 63 | 64 | ####Set minimum value 65 | 66 | ```swift 67 | scaleView.minValue = -3.0 68 | ``` 69 | 70 | ####Set maximum value 71 | 72 | ```swift 73 | scaleView.maxValue = 3.0 74 | ``` 75 | 76 | ####Set number of ticks between values value 77 | 78 | ```swift 79 | scaleView.numberOfTicksBetweenValues = 2 80 | ``` 81 | 82 | ####Set space between ticks 83 | 84 | ```swift 85 | scaleView.spaceBetweenTicks = 20.0 86 | ``` 87 | 88 | ####Set tick label visibility 89 | 90 | ```swift 91 | scaleView.showTickLabels = true 92 | ``` 93 | 94 | ####Set a delegate 95 | 96 | ```swift 97 | scaleView.delegate = self 98 | ``` 99 | 100 | ####Set ability to snap to the nearest value 101 | 102 | ```swift 103 | scaleView.snapEnabled = true 104 | ``` 105 | 106 | ####Set bounces value 107 | 108 | ```swift 109 | scaleView.bounces = false 110 | ``` 111 | 112 | ####Set tick (and center/arrow view) color 113 | 114 | ```swift 115 | scaleView.tickColor = UIColor.whiteColor() 116 | ``` 117 | 118 | ####Set center/arrow image 119 | 120 | ```swift 121 | scaleView.centerArrowImage = UIImage(named: "arrowPointer") 122 | ``` 123 | 124 | ### Control actions 125 | #### Increase current value 126 | 127 | ```swift 128 | scaleView.increaseValue() 129 | ``` 130 | #### Decrease current value 131 | 132 | ```swift 133 | scaleView.decreaseValue() 134 | ``` 135 | #### Reset current value 136 | 137 | ```swift 138 | scaleView.reset() 139 | ``` 140 | #### Gestures 141 | In addition to increase/decrease/reset actions ScaleView allows you to double tap to trigger reset action 142 | 143 | ### More 144 | 145 | For more details try Xcode [Demo project](https://github.com/kronik/ScalePicker/blob/master/Demo) 146 | 147 | ## License 148 | 149 | ScalePicker is released under the MIT license. See [LICENSE](https://raw.githubusercontent.com/kronik/ScalePicker/master/LICENSE) for details. 150 | -------------------------------------------------------------------------------- /Demo/Pods/ScalePicker/ScalePicker/SlidePickerFlowLayout.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SlidePickerFlowLayout.swift 3 | // Dmitry Klimkin 4 | // 5 | // Created by Dmitry Klimkin on 15/3/16. 6 | // Copyright © 2016 Dmitry Klimkin. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | public class SlidePickerFlowLayout: UICollectionViewFlowLayout { 13 | 14 | } -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 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 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## ScalePicker 5 | 6 | The MIT License (MIT) 7 | 8 | Copyright (c) 2016 Dmitry Klimkin 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | 28 | 29 | ## XLForm 30 | 31 | The MIT License (MIT) 32 | 33 | Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) 34 | 35 | Permission is hereby granted, free of charge, to any person obtaining a copy of 36 | this software and associated documentation files (the "Software"), to deal in 37 | the Software without restriction, including without limitation the rights to 38 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 39 | the Software, and to permit persons to whom the Software is furnished to do so, 40 | subject to the following conditions: 41 | 42 | The above copyright notice and this permission notice shall be included in all 43 | copies or substantial portions of the Software. 44 | 45 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 46 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 47 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 48 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 49 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 50 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 51 | 52 | Generated by CocoaPods - http://cocoapods.org 53 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods/Pods-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 | The MIT License (MIT) 18 | 19 | Copyright (c) 2016 Dmitry Klimkin <dmitry.klimkin@gmail.com> 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), to deal 23 | in the Software without restriction, including without limitation the rights 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | copies of the Software, and to permit persons to whom the Software is 26 | furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in all 29 | copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | SOFTWARE. 38 | 39 | Title 40 | ScalePicker 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | The MIT License (MIT) 47 | 48 | Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) 49 | 50 | Permission is hereby granted, free of charge, to any person obtaining a copy of 51 | this software and associated documentation files (the "Software"), to deal in 52 | the Software without restriction, including without limitation the rights to 53 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 54 | the Software, and to permit persons to whom the Software is furnished to do so, 55 | subject to the following conditions: 56 | 57 | The above copyright notice and this permission notice shall be included in all 58 | copies or substantial portions of the Software. 59 | 60 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 61 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 62 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 63 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 64 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 65 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 66 | 67 | Title 68 | XLForm 69 | Type 70 | PSGroupSpecifier 71 | 72 | 73 | FooterText 74 | Generated by CocoaPods - http://cocoapods.org 75 | Title 76 | 77 | Type 78 | PSGroupSpecifier 79 | 80 | 81 | StringsTable 82 | Acknowledgements 83 | Title 84 | Acknowledgements 85 | 86 | 87 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods/Pods-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods : NSObject 3 | @end 4 | @implementation PodsDummy_Pods 5 | @end 6 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods/Pods-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="${CONFIGURATION_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} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --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 "Pods/ScalePicker.framework" 88 | install_framework "Pods/XLForm.framework" 89 | fi 90 | if [[ "$CONFIGURATION" == "Release" ]]; then 91 | install_framework "Pods/ScalePicker.framework" 92 | install_framework "Pods/XLForm.framework" 93 | fi 94 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods/Pods-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_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 | realpath() { 12 | DIRECTORY="$(cd "${1%/*}" && pwd)" 13 | FILENAME="${1##*/}" 14 | echo "$DIRECTORY/$FILENAME" 15 | } 16 | 17 | install_resource() 18 | { 19 | case $1 in 20 | *.storyboard) 21 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 22 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 23 | ;; 24 | *.xib) 25 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 26 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 27 | ;; 28 | *.framework) 29 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 30 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 31 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 32 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 33 | ;; 34 | *.xcdatamodel) 35 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 36 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 37 | ;; 38 | *.xcdatamodeld) 39 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 40 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 41 | ;; 42 | *.xcmappingmodel) 43 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 44 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 45 | ;; 46 | *.xcassets) 47 | ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") 48 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 49 | ;; 50 | /*) 51 | echo "$1" 52 | echo "$1" >> "$RESOURCES_TO_COPY" 53 | ;; 54 | *) 55 | echo "${PODS_ROOT}/$1" 56 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 57 | ;; 58 | esac 59 | } 60 | 61 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 62 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 63 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 64 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 65 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 66 | fi 67 | rm -f "$RESOURCES_TO_COPY" 68 | 69 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 70 | then 71 | case "${TARGETED_DEVICE_FAMILY}" in 72 | 1,2) 73 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 74 | ;; 75 | 1) 76 | TARGET_DEVICE_ARGS="--target-device iphone" 77 | ;; 78 | 2) 79 | TARGET_DEVICE_ARGS="--target-device ipad" 80 | ;; 81 | *) 82 | TARGET_DEVICE_ARGS="--target-device mac" 83 | ;; 84 | esac 85 | 86 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 87 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 88 | while read line; do 89 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 90 | XCASSET_FILES+=("$line") 91 | fi 92 | done <<<"$OTHER_XCASSETS" 93 | 94 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 95 | fi 96 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods/Pods-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double PodsVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char PodsVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods/Pods.debug.xcconfig: -------------------------------------------------------------------------------- 1 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/ScalePicker.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/XLForm.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "ScalePicker" -framework "XLForm" 6 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods/Pods.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods { 2 | umbrella header "Pods-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods/Pods.release.xcconfig: -------------------------------------------------------------------------------- 1 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/ScalePicker.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/XLForm.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "ScalePicker" -framework "XLForm" 6 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/XLForm/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 3.1.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/XLForm/XLForm-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_XLForm : NSObject 3 | @end 4 | @implementation PodsDummy_XLForm 5 | @end 6 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/XLForm/XLForm-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/XLForm/XLForm-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "XLFormBaseCell.h" 4 | #import "XLFormButtonCell.h" 5 | #import "XLFormCheckCell.h" 6 | #import "XLFormDateCell.h" 7 | #import "XLFormDatePickerCell.h" 8 | #import "XLFormDescriptorCell.h" 9 | #import "XLFormImageCell.h" 10 | #import "XLFormInlineRowDescriptorCell.h" 11 | #import "XLFormInlineSelectorCell.h" 12 | #import "XLFormLeftRightSelectorCell.h" 13 | #import "XLFormPickerCell.h" 14 | #import "XLFormSegmentedCell.h" 15 | #import "XLFormSelectorCell.h" 16 | #import "XLFormSliderCell.h" 17 | #import "XLFormStepCounterCell.h" 18 | #import "XLFormSwitchCell.h" 19 | #import "XLFormTextFieldCell.h" 20 | #import "XLFormTextViewCell.h" 21 | #import "XLFormOptionsObject.h" 22 | #import "XLFormOptionsViewController.h" 23 | #import "XLFormRowDescriptorViewController.h" 24 | #import "XLFormViewController.h" 25 | #import "XLFormDescriptor.h" 26 | #import "XLFormDescriptorDelegate.h" 27 | #import "XLFormRowDescriptor.h" 28 | #import "XLFormSectionDescriptor.h" 29 | #import "NSArray+XLFormAdditions.h" 30 | #import "NSExpression+XLFormAdditions.h" 31 | #import "NSObject+XLFormAdditions.h" 32 | #import "NSPredicate+XLFormAdditions.h" 33 | #import "NSString+XLFormAdditions.h" 34 | #import "UIView+XLFormAdditions.h" 35 | #import "XLFormRightDetailCell.h" 36 | #import "XLFormRightImageButton.h" 37 | #import "XLFormRowNavigationAccessoryView.h" 38 | #import "XLFormTextView.h" 39 | #import "XLFormRegexValidator.h" 40 | #import "XLFormValidationStatus.h" 41 | #import "XLFormValidator.h" 42 | #import "XLFormValidatorProtocol.h" 43 | #import "XLForm.h" 44 | 45 | FOUNDATION_EXPORT double XLFormVersionNumber; 46 | FOUNDATION_EXPORT const unsigned char XLFormVersionString[]; 47 | 48 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/XLForm/XLForm.modulemap: -------------------------------------------------------------------------------- 1 | framework module XLForm { 2 | umbrella header "XLForm-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/XLForm/XLForm.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/XLForm" "${PODS_ROOT}/Headers/Public" 3 | OTHER_LDFLAGS = -framework "CoreGraphics" -framework "Foundation" -framework "UIKit" 4 | PODS_ROOT = ${SRCROOT} 5 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Demo/Pods/XLForm/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com ) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Cell/XLFormBaseCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormBaseCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormDescriptorCell.h" 27 | #import "XLFormViewController.h" 28 | #import 29 | 30 | @class XLFormViewController; 31 | @class XLFormRowDescriptor; 32 | 33 | 34 | @interface XLFormBaseCell : UITableViewCell 35 | 36 | @property (nonatomic, weak) XLFormRowDescriptor * rowDescriptor; 37 | 38 | -(XLFormViewController *)formViewController; 39 | 40 | @end 41 | 42 | 43 | @protocol XLFormReturnKeyProtocol 44 | 45 | @property UIReturnKeyType returnKeyType; 46 | @property UIReturnKeyType nextReturnKeyType; 47 | 48 | @end 49 | 50 | 51 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Cell/XLFormBaseCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormBaseCell.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormBaseCell.h" 27 | 28 | @implementation XLFormBaseCell 29 | 30 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 31 | { 32 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 33 | if (self) { 34 | [self configure]; 35 | } 36 | return self; 37 | } 38 | 39 | - (void)awakeFromNib 40 | { 41 | [super awakeFromNib]; 42 | [self configure]; 43 | } 44 | 45 | - (void)configure 46 | { 47 | } 48 | 49 | - (void)update 50 | { 51 | self.textLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; 52 | self.detailTextLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; 53 | self.textLabel.textColor = self.rowDescriptor.isDisabled ? [UIColor grayColor] : [UIColor blackColor]; 54 | } 55 | 56 | -(void)highlight 57 | { 58 | } 59 | 60 | -(void)unhighlight 61 | { 62 | } 63 | 64 | -(XLFormViewController *)formViewController 65 | { 66 | id responder = self; 67 | while (responder){ 68 | if ([responder isKindOfClass:[XLFormViewController class]]){ 69 | return responder; 70 | } 71 | responder = [responder nextResponder]; 72 | } 73 | return nil; 74 | } 75 | 76 | #pragma mark - Navigation Between Fields 77 | 78 | -(UIView *)inputAccessoryView 79 | { 80 | UIView * inputAccessoryView = [self.formViewController inputAccessoryViewForRowDescriptor:self.rowDescriptor]; 81 | if (inputAccessoryView){ 82 | return inputAccessoryView; 83 | } 84 | return [super inputAccessoryView]; 85 | } 86 | 87 | -(BOOL)formDescriptorCellCanBecomeFirstResponder 88 | { 89 | return NO; 90 | } 91 | 92 | #pragma mark - 93 | 94 | -(BOOL)becomeFirstResponder 95 | { 96 | BOOL result = [super becomeFirstResponder]; 97 | if (result){ 98 | [self.formViewController beginEditing:self.rowDescriptor]; 99 | } 100 | return result; 101 | } 102 | 103 | -(BOOL)resignFirstResponder 104 | { 105 | BOOL result = [super resignFirstResponder]; 106 | if (result){ 107 | [self.formViewController endEditing:self.rowDescriptor]; 108 | } 109 | return result; 110 | } 111 | 112 | @end 113 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Cell/XLFormButtonCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormButtonCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormBaseCell.h" 27 | #import 28 | 29 | @interface XLFormButtonCell : XLFormBaseCell 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Cell/XLFormCheckCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormCheckCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormBaseCell.h" 27 | 28 | @interface XLFormCheckCell : XLFormBaseCell 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Cell/XLFormCheckCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormCheckCell.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormCheckCell.h" 27 | 28 | @implementation XLFormCheckCell 29 | 30 | #pragma mark - XLFormDescriptorCell 31 | 32 | - (void)configure 33 | { 34 | [super configure]; 35 | self.accessoryType = UITableViewCellAccessoryCheckmark; 36 | self.editingAccessoryType = self.accessoryType; 37 | } 38 | 39 | - (void)update 40 | { 41 | [super update]; 42 | self.textLabel.text = self.rowDescriptor.title; 43 | self.accessoryType = [self.rowDescriptor.value boolValue] ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone; 44 | self.editingAccessoryType = self.accessoryType; 45 | CGFloat red, green, blue, alpha; 46 | [self.tintColor getRed:&red green:&green blue:&blue alpha:&alpha]; 47 | self.selectionStyle = UITableViewCellSelectionStyleDefault; 48 | if (self.rowDescriptor.isDisabled){ 49 | [self setTintColor:[UIColor colorWithRed:red green:green blue:blue alpha:0.3]]; 50 | self.selectionStyle = UITableViewCellSelectionStyleNone; 51 | } 52 | else{ 53 | [self setTintColor:[UIColor colorWithRed:red green:green blue:blue alpha:1]]; 54 | } 55 | } 56 | // 57 | 58 | -(void)formDescriptorCellDidSelectedWithFormController:(XLFormViewController *)controller 59 | { 60 | self.rowDescriptor.value = [NSNumber numberWithBool:![self.rowDescriptor.value boolValue]]; 61 | [self.formViewController updateFormRow:self.rowDescriptor]; 62 | [controller.tableView deselectRowAtIndexPath:[controller.form indexPathOfFormRow:self.rowDescriptor] animated:YES]; 63 | } 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Cell/XLFormDateCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormDateCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormBaseCell.h" 27 | 28 | typedef NS_ENUM(NSUInteger, XLFormDateDatePickerMode) { 29 | XLFormDateDatePickerModeGetFromRowDescriptor, 30 | XLFormDateDatePickerModeDate, 31 | XLFormDateDatePickerModeDateTime, 32 | XLFormDateDatePickerModeTime 33 | }; 34 | 35 | @interface XLFormDateCell : XLFormBaseCell 36 | 37 | @property (nonatomic) XLFormDateDatePickerMode formDatePickerMode; 38 | @property (nonatomic) NSDate *minimumDate; 39 | @property (nonatomic) NSDate *maximumDate; 40 | @property (nonatomic) NSInteger minuteInterval; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Cell/XLFormDatePickerCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormDatePickerCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLForm.h" 27 | #import "XLFormBaseCell.h" 28 | 29 | #import 30 | 31 | @interface XLFormDatePickerCell : XLFormBaseCell 32 | 33 | @property (nonatomic, readonly) UIDatePicker * datePicker; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Cell/XLFormDatePickerCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormDatePickerCell.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "UIView+XLFormAdditions.h" 27 | 28 | #import "XLFormDatePickerCell.h" 29 | 30 | @implementation XLFormDatePickerCell 31 | 32 | @synthesize datePicker = _datePicker; 33 | @synthesize inlineRowDescriptor = _inlineRowDescriptor; 34 | 35 | -(BOOL)canResignFirstResponder 36 | { 37 | return YES; 38 | } 39 | 40 | #pragma mark - Properties 41 | 42 | -(UIDatePicker *)datePicker 43 | { 44 | if (_datePicker) return _datePicker; 45 | _datePicker = [UIDatePicker autolayoutView]; 46 | [_datePicker addTarget:self action:@selector(datePickerValueChanged:) forControlEvents:UIControlEventValueChanged]; 47 | return _datePicker; 48 | } 49 | 50 | #pragma mark- Target Action 51 | 52 | - (void)datePickerValueChanged:(UIDatePicker *)sender 53 | { 54 | if (self.inlineRowDescriptor){ 55 | self.inlineRowDescriptor.value = sender.date; 56 | [self.formViewController updateFormRow:self.inlineRowDescriptor]; 57 | } 58 | else{ 59 | [self becomeFirstResponder]; 60 | self.rowDescriptor.value = sender.date; 61 | } 62 | } 63 | 64 | #pragma mark - XLFormDescriptorCell 65 | 66 | -(void)configure 67 | { 68 | [super configure]; 69 | [self.contentView addSubview:self.datePicker]; 70 | [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:self.datePicker attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterX multiplier:1 constant:0]]; 71 | [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-0-[datePicker]-0-|" options:0 metrics:0 views:@{@"datePicker" : self.datePicker}]]; 72 | } 73 | 74 | -(void)update 75 | { 76 | [super update]; 77 | [self.datePicker setUserInteractionEnabled:![self.rowDescriptor isDisabled]]; 78 | } 79 | 80 | 81 | +(CGFloat)formDescriptorCellHeightForRowDescriptor:(XLFormRowDescriptor *)rowDescriptor 82 | { 83 | return 216.0f; 84 | } 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Cell/XLFormDescriptorCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormDescriptorCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import 27 | 28 | 29 | @class XLFormRowDescriptor; 30 | @class XLFormViewController; 31 | 32 | @protocol XLFormDescriptorCell 33 | 34 | @required 35 | 36 | @property (nonatomic, weak) XLFormRowDescriptor * rowDescriptor; 37 | -(void)configure; 38 | -(void)update; 39 | 40 | @optional 41 | 42 | +(CGFloat)formDescriptorCellHeightForRowDescriptor:(XLFormRowDescriptor *)rowDescriptor; 43 | -(BOOL)formDescriptorCellCanBecomeFirstResponder; 44 | -(BOOL)formDescriptorCellBecomeFirstResponder; 45 | -(void)formDescriptorCellDidSelectedWithFormController:(XLFormViewController *)controller; 46 | -(NSString *)formDescriptorHttpParameterName; 47 | 48 | 49 | -(void)highlight; 50 | -(void)unhighlight; 51 | 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Cell/XLFormImageCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormBaseCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormBaseCell.h" 27 | 28 | @interface XLFormImageCell : XLFormBaseCell 29 | 30 | @end 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Cell/XLFormInlineRowDescriptorCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormInlineRowDescriptorCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import 27 | 28 | @protocol XLFormInlineRowDescriptorCell 29 | 30 | @property (nonatomic, weak) XLFormRowDescriptor * inlineRowDescriptor; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Cell/XLFormInlineSelectorCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormInlineSelectorCell.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormBaseCell.h" 27 | 28 | @interface XLFormInlineSelectorCell : XLFormBaseCell 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Cell/XLFormLeftRightSelectorCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormLeftRightSelectorCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLForm.h" 27 | #import 28 | 29 | 30 | @interface XLFormLeftRightSelectorCell : XLFormBaseCell 31 | 32 | @property (nonatomic, readonly) UIButton * leftButton; 33 | @property (nonatomic, readonly) UILabel * rightLabel; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Cell/XLFormPickerCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormPickerCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLForm.h" 27 | #import "XLFormBaseCell.h" 28 | 29 | @interface XLFormPickerCell : XLFormBaseCell 30 | 31 | @property (nonatomic) UIPickerView * pickerView; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Cell/XLFormSegmentedCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormSegmentedCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormBaseCell.h" 27 | 28 | @interface XLFormSegmentedCell : XLFormBaseCell 29 | 30 | @property (nonatomic, readonly) UILabel * textLabel; 31 | @property (nonatomic, readonly) UISegmentedControl *segmentedControl; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Cell/XLFormSelectorCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormSelectorCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormBaseCell.h" 27 | #import 28 | 29 | @interface XLFormSelectorCell : XLFormBaseCell 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Cell/XLFormSliderCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormSliderCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLForm.h" 27 | 28 | @interface XLFormSliderCell : XLFormBaseCell 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Cell/XLFormSliderCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormSliderCell.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormSliderCell.h" 27 | #import "UIView+XLFormAdditions.h" 28 | 29 | @interface XLFormSliderCell () 30 | 31 | @property (nonatomic) UISlider * slider; 32 | @property (nonatomic) UILabel * textLabel; 33 | @property NSUInteger steps; 34 | 35 | @end 36 | 37 | @implementation XLFormSliderCell 38 | 39 | @synthesize textLabel = _textLabel; 40 | 41 | - (void)configure 42 | { 43 | self.steps = 0; 44 | [self.slider addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged]; 45 | [self.contentView addSubview:self.slider]; 46 | [self.contentView addSubview:self.textLabel]; 47 | self.selectionStyle = UITableViewCellSelectionStyleNone; 48 | [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:self.textLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1 constant:10]]; 49 | [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:self.slider attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1 constant:44]]; 50 | [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[textLabel]-|" options:0 metrics:0 views:@{@"textLabel": self.textLabel}]]; 51 | [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[slider]-|" options:0 metrics:0 views:@{@"slider": self.slider}]]; 52 | 53 | [self valueChanged:nil]; 54 | } 55 | 56 | -(void)update { 57 | 58 | [super update]; 59 | self.textLabel.text = self.rowDescriptor.title; 60 | self.slider.value = [self.rowDescriptor.value floatValue]; 61 | self.slider.enabled = !self.rowDescriptor.isDisabled; 62 | [self valueChanged:nil]; 63 | } 64 | 65 | -(void)valueChanged:(UISlider*)_slider { 66 | if(self.steps != 0) { 67 | self.slider.value = roundf((self.slider.value-self.slider.minimumValue)/(self.slider.maximumValue-self.slider.minimumValue)*self.steps)*(self.slider.maximumValue-self.slider.minimumValue)/self.steps + self.slider.minimumValue; 68 | } 69 | self.rowDescriptor.value = @(self.slider.value); 70 | } 71 | 72 | +(CGFloat)formDescriptorCellHeightForRowDescriptor:(XLFormRowDescriptor *)rowDescriptor { 73 | return 88; 74 | } 75 | 76 | 77 | -(UILabel *)textLabel 78 | { 79 | if (_textLabel) return _textLabel; 80 | _textLabel = [UILabel autolayoutView]; 81 | return _textLabel; 82 | } 83 | 84 | -(UISlider *)slider 85 | { 86 | if (_slider) return _slider; 87 | _slider = [UISlider autolayoutView]; 88 | return _slider; 89 | } 90 | 91 | @end 92 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Cell/XLFormStepCounterCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormStepCounterCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormBaseCell.h" 27 | #import 28 | 29 | @interface XLFormStepCounterCell : XLFormBaseCell 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Cell/XLFormStepCounterCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormStepCounterCell.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | 27 | #import "XLFormStepCounterCell.h" 28 | #import "XLFormRowDescriptor.h" 29 | #import "UIView+XLFormAdditions.h" 30 | 31 | @interface XLFormStepCounterCell () 32 | 33 | @property (nonatomic) UIStepper *stepControl; 34 | @property (nonatomic) UILabel *currentStepValue; 35 | 36 | @end 37 | 38 | @implementation XLFormStepCounterCell 39 | 40 | 41 | #pragma mark - XLFormStepCounterCell 42 | 43 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { 44 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 45 | if (self) { 46 | // Initialization code 47 | } 48 | return self; 49 | } 50 | 51 | - (void)configure 52 | { 53 | [super configure]; 54 | self.selectionStyle = UITableViewCellSelectionStyleNone; 55 | 56 | // Add subviews 57 | [self.contentView addSubview:self.stepControl]; 58 | [self.contentView addSubview:self.currentStepValue]; 59 | 60 | // Add constraints 61 | [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:self.stepControl attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterY multiplier:1 constant:0]]; 62 | [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:self.currentStepValue attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterY multiplier:1 constant:0]]; 63 | [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:self.currentStepValue attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:self.stepControl attribute:NSLayoutAttributeHeight multiplier:1 constant:0]]; 64 | [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[value]-5-[control]-|" options:0 metrics:0 views:@{@"value": self.currentStepValue, @"control":self.stepControl}]]; 65 | } 66 | 67 | - (void)update 68 | { 69 | [super update]; 70 | self.textLabel.text = self.rowDescriptor.title; 71 | self.stepControl.value = [self.rowDescriptor.value doubleValue]; 72 | self.currentStepValue.text = self.rowDescriptor.value ? [NSString stringWithFormat:@"%@", self.rowDescriptor.value] : nil; 73 | [self stepControl].enabled = !self.rowDescriptor.isDisabled; 74 | [self currentStepValue].font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; 75 | CGFloat red, green, blue, alpha; 76 | [self.tintColor getRed:&red green:&green blue:&blue alpha:&alpha]; 77 | if (self.rowDescriptor.isDisabled) 78 | { 79 | [self setTintColor:[UIColor colorWithRed:red green:green blue:blue alpha:0.3]]; 80 | [self currentStepValue].textColor = [UIColor colorWithRed:red green:green blue:blue alpha:0.3]; 81 | } 82 | else{ 83 | [self setTintColor:[UIColor colorWithRed:red green:green blue:blue alpha:1]]; 84 | [self currentStepValue].textColor = [UIColor colorWithRed:red green:green blue:blue alpha:1]; 85 | } 86 | } 87 | 88 | 89 | #pragma mark - Events 90 | 91 | - (void)valueChanged:(id)sender 92 | { 93 | UIStepper *stepper = self.stepControl; 94 | 95 | self.rowDescriptor.value = @(stepper.value); 96 | self.currentStepValue.text = [NSString stringWithFormat:@"%.f", stepper.value]; 97 | } 98 | 99 | 100 | #pragma mark - Properties 101 | 102 | - (UIStepper *)stepControl 103 | { 104 | if (!_stepControl) { 105 | _stepControl = [UIStepper autolayoutView]; 106 | [_stepControl addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged]; 107 | } 108 | return _stepControl; 109 | } 110 | 111 | -(UILabel *)currentStepValue 112 | { 113 | if (!_currentStepValue) { 114 | _currentStepValue = [UILabel autolayoutView]; 115 | } 116 | return _currentStepValue; 117 | } 118 | 119 | @end 120 | 121 | 122 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Cell/XLFormSwitchCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormSwitchCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormBaseCell.h" 27 | 28 | @interface XLFormSwitchCell : XLFormBaseCell 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Cell/XLFormSwitchCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormSwitchCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormRowDescriptor.h" 27 | 28 | #import "XLFormSwitchCell.h" 29 | 30 | @implementation XLFormSwitchCell 31 | 32 | #pragma mark - XLFormDescriptorCell 33 | 34 | - (void)configure 35 | { 36 | [super configure]; 37 | self.selectionStyle = UITableViewCellSelectionStyleNone; 38 | self.accessoryView = [[UISwitch alloc] init]; 39 | self.editingAccessoryView = self.accessoryView; 40 | [self.switchControl addTarget:self action:@selector(valueChanged) forControlEvents:UIControlEventValueChanged]; 41 | } 42 | 43 | - (void)update 44 | { 45 | [super update]; 46 | self.textLabel.text = self.rowDescriptor.title; 47 | self.switchControl.on = [self.rowDescriptor.value boolValue]; 48 | self.switchControl.enabled = !self.rowDescriptor.isDisabled; 49 | } 50 | 51 | - (UISwitch *)switchControl 52 | { 53 | return (UISwitch *)self.accessoryView; 54 | } 55 | 56 | - (void)valueChanged 57 | { 58 | self.rowDescriptor.value = @(self.switchControl.on); 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Cell/XLFormTextFieldCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormTextFieldCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormBaseCell.h" 27 | #import 28 | 29 | extern NSString *const XLFormTextFieldLengthPercentage; 30 | 31 | @interface XLFormTextFieldCell : XLFormBaseCell 32 | 33 | @property (nonatomic, readonly) UILabel * textLabel; 34 | @property (nonatomic, readonly) UITextField * textField; 35 | 36 | @property (nonatomic) NSNumber *textFieldLengthPercentage; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Cell/XLFormTextViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormTextViewCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormTextView.h" 27 | #import "XLFormBaseCell.h" 28 | #import 29 | 30 | extern NSString *const XLFormTextViewLengthPercentage; 31 | 32 | @interface XLFormTextViewCell : XLFormBaseCell 33 | 34 | @property (nonatomic, readonly) UILabel * label DEPRECATED_ATTRIBUTE DEPRECATED_MSG_ATTRIBUTE("Use textLabel instead"); 35 | @property (nonatomic, readonly) UILabel * textLabel; 36 | @property (nonatomic, readonly) XLFormTextView * textView; 37 | 38 | @property (nonatomic) NSNumber *textViewLengthPercentage; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Controllers/XLFormOptionsObject.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormOptionsObject.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormRowDescriptor.h" 27 | #import 28 | 29 | @interface XLFormOptionsObject : NSObject 30 | 31 | +(XLFormOptionsObject *)formOptionsObjectWithValue:(id)value displayText:(NSString *)displayText; 32 | +(XLFormOptionsObject *)formOptionsOptionForValue:(id)value fromOptions:(NSArray *)options; 33 | +(XLFormOptionsObject *)formOptionsOptionForDisplayText:(NSString *)displayText fromOptions:(NSArray *)options; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Controllers/XLFormOptionsObject.m: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormOptionsObject.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormOptionsObject.h" 27 | 28 | @implementation XLFormOptionsObject 29 | { 30 | NSString * _formDisplaytext; 31 | id _formValue; 32 | } 33 | 34 | +(XLFormOptionsObject *)formOptionsObjectWithValue:(id)value displayText:(NSString *)displayText 35 | { 36 | return [[XLFormOptionsObject alloc] initWithValue:value displayText:displayText]; 37 | } 38 | 39 | -(id)initWithValue:(id)value displayText:(NSString *)displayText 40 | { 41 | self = [super init]; 42 | if (self){ 43 | _formValue = value; 44 | _formDisplaytext = displayText; 45 | } 46 | return self; 47 | } 48 | 49 | +(XLFormOptionsObject *)formOptionsOptionForValue:(id)value fromOptions:(NSArray *)options 50 | { 51 | for (XLFormOptionsObject * option in options) { 52 | if ([option.formValue isEqual:value]){ 53 | return option; 54 | } 55 | } 56 | return nil; 57 | } 58 | 59 | +(XLFormOptionsObject *)formOptionsOptionForDisplayText:(NSString *)displayText fromOptions:(NSArray *)options 60 | { 61 | for (XLFormOptionsObject * option in options) { 62 | if ([option.formDisplayText isEqualToString:displayText]){ 63 | return option; 64 | } 65 | } 66 | return nil; 67 | } 68 | 69 | -(BOOL)isEqual:(id)object 70 | { 71 | if (![[self class] isEqual:[object class]]){ 72 | return NO; 73 | } 74 | return [self.formValue isEqual:((XLFormOptionsObject *)object).formValue]; 75 | } 76 | 77 | #pragma mark - XLFormOptionObject 78 | 79 | -(NSString *)formDisplayText 80 | { 81 | return _formDisplaytext; 82 | } 83 | 84 | -(id)formValue 85 | { 86 | return _formValue; 87 | } 88 | #pragma mark - NSCoding 89 | -(void)encodeWithCoder:(NSCoder *)encoder 90 | { 91 | 92 | [encoder encodeObject:self.formValue 93 | forKey:@"formValue"]; 94 | [encoder encodeObject:self.formDisplayText 95 | forKey:@"formDisplayText"]; 96 | } 97 | -(id)initWithCoder:(NSCoder *)decoder 98 | { 99 | if ((self=[super init])) { 100 | 101 | [self setValue:[decoder decodeObjectForKey:@"formValue"] 102 | forKey:@"formValue"]; 103 | [self setValue:[decoder decodeObjectForKey:@"formDisplayText"] 104 | forKey:@"formDisplaytext"]; 105 | 106 | } 107 | 108 | return self; 109 | 110 | } 111 | @end 112 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Controllers/XLFormOptionsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormOptionsViewController.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | 27 | 28 | #import "XLFormRowDescriptorViewController.h" 29 | #import "XLFormRowDescriptor.h" 30 | 31 | @interface XLFormOptionsViewController : UITableViewController 32 | 33 | - (id)initWithStyle:(UITableViewStyle)style; 34 | 35 | 36 | - (id)initWithStyle:(UITableViewStyle)style 37 | titleHeaderSection:(NSString *)titleHeaderSection 38 | titleFooterSection:(NSString *)titleFooterSection; 39 | 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Controllers/XLFormRowDescriptorViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormRowDescriptorViewController.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | 27 | #import "XLFormRowDescriptor.h" 28 | #import 29 | 30 | @protocol XLFormRowDescriptorViewController 31 | 32 | @required 33 | @property (nonatomic) XLFormRowDescriptor * rowDescriptor; 34 | 35 | @end 36 | 37 | @protocol XLFormRowDescriptorPopoverViewController 38 | 39 | @required 40 | @property (nonatomic) UIPopoverController * popoverController; 41 | 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Controllers/XLFormViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormViewController.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import 27 | #import "XLFormOptionsViewController.h" 28 | #import "XLFormDescriptor.h" 29 | #import "XLFormSectionDescriptor.h" 30 | #import "XLFormDescriptorDelegate.h" 31 | #import "XLFormRowNavigationAccessoryView.h" 32 | #import "XLFormBaseCell.h" 33 | 34 | @class XLFormViewController; 35 | @class XLFormRowDescriptor; 36 | @class XLFormSectionDescriptor; 37 | @class XLFormDescriptor; 38 | @class XLFormBaseCell; 39 | 40 | typedef NS_ENUM(NSUInteger, XLFormRowNavigationDirection) { 41 | XLFormRowNavigationDirectionPrevious = 0, 42 | XLFormRowNavigationDirectionNext 43 | }; 44 | 45 | @protocol XLFormViewControllerDelegate 46 | 47 | @optional 48 | 49 | -(void)didSelectFormRow:(XLFormRowDescriptor *)formRow; 50 | -(void)deselectFormRow:(XLFormRowDescriptor *)formRow; 51 | -(void)reloadFormRow:(XLFormRowDescriptor *)formRow; 52 | -(XLFormBaseCell *)updateFormRow:(XLFormRowDescriptor *)formRow; 53 | 54 | -(NSDictionary *)formValues; 55 | -(NSDictionary *)httpParameters; 56 | 57 | -(XLFormRowDescriptor *)formRowFormMultivaluedFormSection:(XLFormSectionDescriptor *)formSection; 58 | -(void)multivaluedInsertButtonTapped:(XLFormRowDescriptor *)formRow; 59 | -(UIStoryboard *)storyboardForRow:(XLFormRowDescriptor *)formRow; 60 | 61 | -(NSArray *)formValidationErrors; 62 | -(void)showFormValidationError:(NSError *)error; 63 | 64 | -(UITableViewRowAnimation)insertRowAnimationForRow:(XLFormRowDescriptor *)formRow; 65 | -(UITableViewRowAnimation)deleteRowAnimationForRow:(XLFormRowDescriptor *)formRow; 66 | -(UITableViewRowAnimation)insertRowAnimationForSection:(XLFormSectionDescriptor *)formSection; 67 | -(UITableViewRowAnimation)deleteRowAnimationForSection:(XLFormSectionDescriptor *)formSection; 68 | 69 | // InputAccessoryView 70 | -(UIView *)inputAccessoryViewForRowDescriptor:(XLFormRowDescriptor *)rowDescriptor; 71 | -(XLFormRowDescriptor *)nextRowDescriptorForRow:(XLFormRowDescriptor*)currentRow withDirection:(XLFormRowNavigationDirection)direction; 72 | 73 | // highlight/unhighlight 74 | -(void)beginEditing:(XLFormRowDescriptor *)rowDescriptor; 75 | -(void)endEditing:(XLFormRowDescriptor *)rowDescriptor; 76 | 77 | -(void)ensureRowIsVisible:(XLFormRowDescriptor *)inlineRowDescriptor; 78 | 79 | @end 80 | 81 | @interface XLFormViewController : UIViewController 82 | 83 | @property XLFormDescriptor * form; 84 | @property IBOutlet UITableView * tableView; 85 | 86 | -(id)initWithForm:(XLFormDescriptor *)form; 87 | -(id)initWithForm:(XLFormDescriptor *)form style:(UITableViewStyle)style; 88 | +(NSMutableDictionary *)cellClassesForRowDescriptorTypes; 89 | +(NSMutableDictionary *)inlineRowDescriptorTypesForRowDescriptorTypes; 90 | 91 | -(void)performFormSelector:(SEL)selector withObject:(id)sender; 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Descriptors/XLFormDescriptor.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormDescriptor.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormSectionDescriptor.h" 27 | #import "XLFormRowDescriptor.h" 28 | #import "XLFormDescriptorDelegate.h" 29 | #import 30 | 31 | extern NSString * __nonnull const XLFormErrorDomain; 32 | extern NSString * __nonnull const XLValidationStatusErrorKey; 33 | 34 | typedef NS_ENUM(NSInteger, XLFormErrorCode) 35 | { 36 | XLFormErrorCodeGen = -999, 37 | XLFormErrorCodeRequired = -1000 38 | }; 39 | 40 | typedef NS_OPTIONS(NSUInteger, XLFormRowNavigationOptions) { 41 | XLFormRowNavigationOptionNone = 0, 42 | XLFormRowNavigationOptionEnabled = 1 << 0, 43 | XLFormRowNavigationOptionStopDisableRow = 1 << 1, 44 | XLFormRowNavigationOptionSkipCanNotBecomeFirstResponderRow = 1 << 2, 45 | XLFormRowNavigationOptionStopInlineRow = 1 << 3, 46 | }; 47 | 48 | @class XLFormSectionDescriptor; 49 | 50 | @interface XLFormDescriptor : NSObject 51 | 52 | @property (readonly, nonatomic, nonnull) NSMutableArray * formSections; 53 | @property (readonly, nullable) NSString * title; 54 | @property (nonatomic) BOOL endEditingTableViewOnScroll; 55 | @property (nonatomic) BOOL assignFirstResponderOnShow; 56 | @property (nonatomic) BOOL addAsteriskToRequiredRowsTitle; 57 | @property (getter=isDisabled) BOOL disabled; 58 | @property (nonatomic) XLFormRowNavigationOptions rowNavigationOptions; 59 | 60 | @property (weak, nullable) id delegate; 61 | 62 | +(nonnull instancetype)formDescriptor; 63 | +(nonnull instancetype)formDescriptorWithTitle:(nullable NSString *)title; 64 | 65 | -(void)addFormSection:(nonnull XLFormSectionDescriptor *)formSection; 66 | -(void)addFormSection:(nonnull XLFormSectionDescriptor *)formSection atIndex:(NSUInteger)index; 67 | -(void)addFormSection:(nonnull XLFormSectionDescriptor *)formSection afterSection:(nonnull XLFormSectionDescriptor *)afterSection; 68 | -(void)addFormRow:(nonnull XLFormRowDescriptor *)formRow beforeRow:(nonnull XLFormRowDescriptor *)afterRow; 69 | -(void)addFormRow:(nonnull XLFormRowDescriptor *)formRow beforeRowTag:(nonnull NSString *)afterRowTag; 70 | -(void)addFormRow:(nonnull XLFormRowDescriptor *)formRow afterRow:(nonnull XLFormRowDescriptor *)afterRow; 71 | -(void)addFormRow:(nonnull XLFormRowDescriptor *)formRow afterRowTag:(nonnull NSString *)afterRowTag; 72 | -(void)removeFormSectionAtIndex:(NSUInteger)index; 73 | -(void)removeFormSection:(nonnull XLFormSectionDescriptor *)formSection; 74 | -(void)removeFormRow:(nonnull XLFormRowDescriptor *)formRow; 75 | -(void)removeFormRowWithTag:(nonnull NSString *)tag; 76 | 77 | -(nullable XLFormRowDescriptor *)formRowWithTag:(nonnull NSString *)tag; 78 | -(nullable XLFormRowDescriptor *)formRowAtIndex:(nonnull NSIndexPath *)indexPath; 79 | -(nullable XLFormRowDescriptor *)formRowWithHash:(NSUInteger)hash; 80 | -(nullable XLFormSectionDescriptor *)formSectionAtIndex:(NSUInteger)index; 81 | 82 | -(nullable NSIndexPath *)indexPathOfFormRow:(nonnull XLFormRowDescriptor *)formRow; 83 | 84 | -(nonnull NSDictionary *)formValues; 85 | -(nonnull NSDictionary *)httpParameters:(nonnull XLFormViewController *)formViewController; 86 | 87 | -(nonnull NSArray *)localValidationErrors:(nonnull XLFormViewController *)formViewController; 88 | -(void)setFirstResponder:(nonnull XLFormViewController *)formViewController; 89 | 90 | -(nullable XLFormRowDescriptor *)nextRowDescriptorForRow:(nonnull XLFormRowDescriptor *)currentRow; 91 | -(nullable XLFormRowDescriptor *)previousRowDescriptorForRow:(nonnull XLFormRowDescriptor *)currentRow; 92 | 93 | -(void)forceEvaluate; 94 | 95 | @end 96 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Descriptors/XLFormDescriptorDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormDescriptorDelegate.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormDescriptor.h" 27 | #import 28 | 29 | @class XLFormSectionDescriptor; 30 | 31 | typedef NS_ENUM(NSUInteger, XLPredicateType) { 32 | XLPredicateTypeDisabled = 0, 33 | XLPredicateTypeHidden 34 | }; 35 | 36 | 37 | @protocol XLFormDescriptorDelegate 38 | 39 | @required 40 | 41 | -(void)formSectionHasBeenRemoved:(XLFormSectionDescriptor *)formSection atIndex:(NSUInteger)index; 42 | -(void)formSectionHasBeenAdded:(XLFormSectionDescriptor *)formSection atIndex:(NSUInteger)index; 43 | -(void)formRowHasBeenAdded:(XLFormRowDescriptor *)formRow atIndexPath:(NSIndexPath *)indexPath; 44 | -(void)formRowHasBeenRemoved:(XLFormRowDescriptor *)formRow atIndexPath:(NSIndexPath *)indexPath; 45 | -(void)formRowDescriptorValueHasChanged:(XLFormRowDescriptor *)formRow oldValue:(id)oldValue newValue:(id)newValue; 46 | -(void)formRowDescriptorPredicateHasChanged:(XLFormRowDescriptor *)formRow 47 | oldValue:(id)oldValue 48 | newValue:(id)newValue 49 | predicateType:(XLPredicateType)predicateType; 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Descriptors/XLFormSectionDescriptor.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormSectionDescriptor.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormRowDescriptor.h" 27 | #import 28 | 29 | typedef NS_OPTIONS(NSUInteger, XLFormSectionOptions) { 30 | XLFormSectionOptionNone = 0, 31 | XLFormSectionOptionCanInsert = 1 << 0, 32 | XLFormSectionOptionCanDelete = 1 << 1, 33 | XLFormSectionOptionCanReorder = 1 << 2 34 | }; 35 | 36 | typedef NS_ENUM(NSUInteger, XLFormSectionInsertMode) { 37 | XLFormSectionInsertModeLastRow = 0, 38 | XLFormSectionInsertModeButton = 2 39 | }; 40 | 41 | @class XLFormDescriptor; 42 | 43 | @interface XLFormSectionDescriptor : NSObject 44 | 45 | @property (nonatomic, nullable) NSString * title; 46 | @property (nonatomic, nullable) NSString * footerTitle; 47 | @property (readonly, nonnull) NSMutableArray * formRows; 48 | 49 | @property (readonly) XLFormSectionInsertMode sectionInsertMode; 50 | @property (readonly) XLFormSectionOptions sectionOptions; 51 | @property (nullable) XLFormRowDescriptor * multivaluedRowTemplate; 52 | @property (readonly, nullable) XLFormRowDescriptor * multivaluedAddButton; 53 | @property (nonatomic, nullable) NSString * multivaluedTag; 54 | 55 | @property (weak, null_unspecified) XLFormDescriptor * formDescriptor; 56 | 57 | @property (nonnull) id hidden; 58 | -(BOOL)isHidden; 59 | 60 | +(nonnull instancetype)formSection; 61 | +(nonnull instancetype)formSectionWithTitle:(nullable NSString *)title; 62 | +(nonnull instancetype)formSectionWithTitle:(nullable NSString *)title multivaluedSection:(BOOL)multivaluedSection DEPRECATED_ATTRIBUTE DEPRECATED_MSG_ATTRIBUTE("Use formSectionWithTitle:sectionType: instead"); 63 | +(nonnull instancetype)formSectionWithTitle:(nullable NSString *)title sectionOptions:(XLFormSectionOptions)sectionOptions; 64 | +(nonnull instancetype)formSectionWithTitle:(nullable NSString *)title sectionOptions:(XLFormSectionOptions)sectionOptions sectionInsertMode:(XLFormSectionInsertMode)sectionInsertMode; 65 | 66 | -(BOOL)isMultivaluedSection; 67 | -(void)addFormRow:(nonnull XLFormRowDescriptor *)formRow; 68 | -(void)addFormRow:(nonnull XLFormRowDescriptor *)formRow afterRow:(nonnull XLFormRowDescriptor *)afterRow; 69 | -(void)addFormRow:(nonnull XLFormRowDescriptor *)formRow beforeRow:(nonnull XLFormRowDescriptor *)beforeRow; 70 | -(void)removeFormRowAtIndex:(NSUInteger)index; 71 | -(void)removeFormRow:(nonnull XLFormRowDescriptor *)formRow; 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Helpers/NSArray+XLFormAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+XLFormAdditions.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import 27 | 28 | @interface NSArray (XLFormAdditions) 29 | 30 | -(NSInteger)formIndexForItem:(id)item; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Helpers/NSArray+XLFormAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+XLFormAdditions.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "NSArray+XLFormAdditions.h" 27 | #import "NSObject+XLFormAdditions.h" 28 | 29 | @implementation NSArray (XLFormAdditions) 30 | 31 | -(NSInteger)formIndexForItem:(id)item 32 | { 33 | for (id selectedValueItem in self) { 34 | if ([[selectedValueItem valueData] isEqual:[item valueData]]){ 35 | return [self indexOfObject:selectedValueItem]; 36 | } 37 | } 38 | return NSNotFound; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Helpers/NSExpression+XLFormAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSExpression+XLFormAdditions.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | 27 | #import 28 | 29 | @interface NSExpression (XLFormAdditions) 30 | 31 | -(NSMutableArray*) getExpressionVars; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Helpers/NSExpression+XLFormAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSExpression+XLFormAdditions.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | 27 | #import "NSExpression+XLFormAdditions.h" 28 | 29 | @implementation NSExpression (XLFormAdditions) 30 | 31 | 32 | -(NSMutableArray*) getExpressionVars{ 33 | switch (self.expressionType) { 34 | case NSFunctionExpressionType:{ 35 | NSString* str = [NSString stringWithFormat:@"%@", self]; 36 | if ([str rangeOfString:@"."].location != NSNotFound) 37 | str = [str substringWithRange:NSMakeRange(1, [str rangeOfString:@"."].location - 1)]; 38 | else 39 | str = [str substringFromIndex:1]; 40 | return [[NSMutableArray alloc] initWithObjects: str, nil]; 41 | break; 42 | } 43 | default: 44 | return nil; 45 | break; 46 | } 47 | } 48 | 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Helpers/NSObject+XLFormAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+XLFormAdditions.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import 27 | 28 | @interface NSObject (XLFormAdditions) 29 | 30 | -(NSString *)displayText; 31 | -(id)valueData; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Helpers/NSObject+XLFormAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+XLFormAdditions.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormRowDescriptor.h" 27 | 28 | #import "NSObject+XLFormAdditions.h" 29 | 30 | @implementation NSObject (XLFormAdditions) 31 | 32 | -(NSString *)displayText 33 | { 34 | if ([self isKindOfClass:[NSString class]] || [self isKindOfClass:[NSNumber class]]){ 35 | return [self description]; 36 | } 37 | if ([self conformsToProtocol:@protocol(XLFormOptionObject)]){ 38 | return [(id)self formDisplayText]; 39 | } 40 | return nil; 41 | } 42 | 43 | -(id)valueData 44 | { 45 | if ([self isKindOfClass:[NSString class]] || [self isKindOfClass:[NSNumber class]] || [self isKindOfClass:[NSDate class]]){ 46 | return self; 47 | } 48 | if ([self isKindOfClass:[NSArray class]]) { 49 | NSMutableArray * result = [NSMutableArray array]; 50 | [(NSArray *)self enumerateObjectsUsingBlock:^(id obj, NSUInteger __unused idx, BOOL __unused *stop) { 51 | [result addObject:[obj valueData]]; 52 | }]; 53 | return result; 54 | } 55 | if ([self conformsToProtocol:@protocol(XLFormOptionObject)]){ 56 | return [(id)self formValue]; 57 | } 58 | return nil; 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Helpers/NSPredicate+XLFormAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSPredicate+XLFormAdditions.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import 27 | 28 | @interface NSPredicate (XLFormAdditions) 29 | 30 | -(NSMutableArray*) getPredicateVars; 31 | @end 32 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Helpers/NSPredicate+XLFormAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSPredicate+XLFormAdditions.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "NSPredicate+XLFormAdditions.h" 26 | #import "NSExpression+XLFormAdditions.h" 27 | 28 | @implementation NSPredicate (XLFormAdditions) 29 | 30 | 31 | -(NSMutableArray*) getPredicateVars{ 32 | NSMutableArray* ret = [[NSMutableArray alloc] init]; 33 | if ([self isKindOfClass:([NSCompoundPredicate class])]) { 34 | for (id object in ((NSCompoundPredicate*) self).subpredicates ) { 35 | [ret addObjectsFromArray:[object getPredicateVars]]; 36 | } 37 | } 38 | else if ([self isKindOfClass:([NSComparisonPredicate class])]){ 39 | [ret addObjectsFromArray:[((NSComparisonPredicate*) self).leftExpression getExpressionVars]]; 40 | [ret addObjectsFromArray:[((NSComparisonPredicate*) self).rightExpression getExpressionVars]]; 41 | } 42 | return ret; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Helpers/NSString+XLFormAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+XLFormAdditions.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import 27 | #import "XLFormDescriptor.h" 28 | 29 | @interface NSString (XLFormAdditions) 30 | 31 | -(NSPredicate *)formPredicate; 32 | 33 | -(NSString *)formKeyForPredicateType:(XLPredicateType)predicateType; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Helpers/NSString+XLFormAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+XLFormAdditions.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "NSString+XLFormAdditions.h" 27 | 28 | @implementation NSString (XLFormAdditions) 29 | 30 | -(NSPredicate *)formPredicate 31 | { 32 | // returns an array of strings where the first one is the new string with the correct replacements 33 | // and the rest are all the tags that appear in the string 34 | NSString* separator = @"$"; 35 | 36 | NSArray* tokens = [self componentsSeparatedByString:separator]; 37 | NSMutableString* new_string = [[NSMutableString alloc] initWithString:tokens[0]]; 38 | NSRange range; 39 | for (int i = 1; i < tokens.count; i++) { 40 | [new_string appendString:separator]; 41 | NSArray* subtokens = [[tokens[i] componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@" <>!=+-&|()"]][0] 42 | componentsSeparatedByString:@"."]; 43 | NSString* tag = subtokens[0]; 44 | NSString* attribute; 45 | if ([subtokens count] >= 2) { 46 | attribute = subtokens[1]; 47 | } 48 | [new_string appendString:tag]; 49 | range = [tokens[i] rangeOfString:[NSString stringWithFormat:@"%@", tag]]; 50 | if (!attribute || (![attribute isEqualToString:@"value"] && ![attribute isEqualToString:@"isHidden"] && ![attribute isEqualToString:@"isDisabled"])){ 51 | [new_string appendString:@".value"]; 52 | } 53 | [new_string appendString:[tokens[i] substringFromIndex:range.location + range.length]]; 54 | } 55 | return [NSPredicate predicateWithFormat:new_string]; 56 | 57 | } 58 | 59 | 60 | -(NSString *)formKeyForPredicateType:(XLPredicateType)predicateType 61 | { 62 | return [NSString stringWithFormat:@"%@-%@", self, (predicateType == XLPredicateTypeHidden ? @"hidden" : @"disabled") ]; 63 | } 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Helpers/UIView+XLFormAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+XLFormAdditions.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormDescriptorCell.h" 27 | #import 28 | 29 | @interface UIView (XLFormAdditions) 30 | 31 | +(id)autolayoutView; 32 | -(NSLayoutConstraint *)layoutConstraintSameHeightOf:(UIView *)view; 33 | -(UIView *)findFirstResponder; 34 | -(UITableViewCell *)formDescriptorCell; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Helpers/UIView+XLFormAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+XLFormAdditions.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "UIView+XLFormAdditions.h" 27 | 28 | @implementation UIView (XLFormAdditions) 29 | 30 | + (id)autolayoutView 31 | { 32 | UIView *view = [self new]; 33 | view.translatesAutoresizingMaskIntoConstraints = NO; 34 | return view; 35 | } 36 | 37 | -(NSLayoutConstraint *)layoutConstraintSameHeightOf:(UIView *)view 38 | { 39 | return [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:view attribute:NSLayoutAttributeHeight multiplier:1.0f constant:0.0f]; 40 | } 41 | 42 | - (UIView *)findFirstResponder 43 | { 44 | if (self.isFirstResponder) { 45 | return self; 46 | } 47 | for (UIView *subView in self.subviews) { 48 | UIView *firstResponder = [subView findFirstResponder]; 49 | if (firstResponder != nil) { 50 | return firstResponder; 51 | } 52 | } 53 | return nil; 54 | } 55 | 56 | - (UITableViewCell *)formDescriptorCell 57 | { 58 | if ([self isKindOfClass:[UITableViewCell class]]) { 59 | if ([self conformsToProtocol:@protocol(XLFormDescriptorCell)]){ 60 | return (UITableViewCell *)self; 61 | } 62 | return nil; 63 | } 64 | if (self.superview) { 65 | UITableViewCell * tableViewCell = [self.superview formDescriptorCell]; 66 | if (tableViewCell != nil) { 67 | return tableViewCell; 68 | } 69 | } 70 | return nil; 71 | } 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Helpers/Views/XLFormRightDetailCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormRightDetailCell.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import 27 | 28 | @interface XLFormRightDetailCell : UITableViewCell 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Helpers/Views/XLFormRightDetailCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormRightDetailCell.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormRightDetailCell.h" 27 | 28 | @implementation XLFormRightDetailCell 29 | 30 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 31 | { 32 | return [super initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:reuseIdentifier]; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Helpers/Views/XLFormRightImageButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormRightImageButton.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import 27 | 28 | @interface XLFormRightImageButton : UIButton 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Helpers/Views/XLFormRightImageButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormRightImageButton.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormRightImageButton.h" 27 | 28 | @implementation XLFormRightImageButton 29 | 30 | 31 | - (CGSize)intrinsicContentSize 32 | { 33 | CGSize s = [super intrinsicContentSize]; 34 | return CGSizeMake(s.width + self.titleEdgeInsets.left + self.titleEdgeInsets.right, 35 | s.height + self.titleEdgeInsets.top + self.titleEdgeInsets.bottom); 36 | 37 | } 38 | 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Helpers/Views/XLFormRowNavigationAccessoryView.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormRowNavigationAccessoryView.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import 27 | 28 | @interface XLFormRowNavigationAccessoryView : UIToolbar 29 | 30 | @property (nonatomic) UIBarButtonItem *previousButton; 31 | @property (nonatomic) UIBarButtonItem *nextButton; 32 | @property (nonatomic) UIBarButtonItem *doneButton; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Helpers/Views/XLFormRowNavigationAccessoryView.m: -------------------------------------------------------------------------------- 1 | // XLFormRowNavigationAccessoryView.m 2 | // XLForm ( https://github.com/xmartlabs/XLForm ) 3 | // 4 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 5 | // 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | 26 | #import "XLFormRowNavigationAccessoryView.h" 27 | 28 | 29 | @interface XLFormRowNavigationAccessoryView () 30 | 31 | @property (nonatomic) UIBarButtonItem *fixedSpace; 32 | @property (nonatomic) UIBarButtonItem *flexibleSpace; 33 | 34 | @end 35 | 36 | @implementation XLFormRowNavigationAccessoryView 37 | 38 | @synthesize previousButton = _previousButton; 39 | @synthesize nextButton = _nextButton; 40 | @synthesize doneButton = _doneButton; 41 | 42 | 43 | - (id)initWithFrame:(CGRect)frame 44 | { 45 | self = [super initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 44.0)]; 46 | if (self) { 47 | self.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleWidth); 48 | NSArray * items = [NSArray arrayWithObjects:self.previousButton, 49 | self.fixedSpace, 50 | self.nextButton, 51 | self.flexibleSpace, 52 | self.doneButton, nil]; 53 | [self setItems:items]; 54 | } 55 | return self; 56 | } 57 | 58 | #pragma mark - Properties 59 | 60 | -(UIBarButtonItem *)previousButton 61 | { 62 | if (_previousButton) return _previousButton; 63 | _previousButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:105 target:nil action:nil]; 64 | return _previousButton; 65 | } 66 | 67 | -(UIBarButtonItem *)fixedSpace 68 | { 69 | if (_fixedSpace) return _fixedSpace; 70 | _fixedSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil]; 71 | _fixedSpace.width = 22.0; 72 | return _fixedSpace; 73 | } 74 | 75 | -(UIBarButtonItem *)nextButton 76 | { 77 | if (_nextButton) return _nextButton; 78 | _nextButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:106 target:nil action:nil]; 79 | return _nextButton; 80 | } 81 | 82 | -(UIBarButtonItem *)flexibleSpace 83 | { 84 | if (_flexibleSpace) return _flexibleSpace; 85 | _flexibleSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]; 86 | return _flexibleSpace; 87 | } 88 | 89 | -(UIBarButtonItem *)doneButton 90 | { 91 | if (_doneButton) return _doneButton; 92 | _doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:nil action:nil]; 93 | return _doneButton; 94 | } 95 | 96 | #pragma mark - Helpers 97 | 98 | - (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent *)event 99 | { 100 | } 101 | 102 | @end 103 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Helpers/Views/XLFormTextView.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormTextView.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | 27 | #import 28 | 29 | @interface XLFormTextView : UITextView 30 | 31 | 32 | @property (nonatomic) NSString *placeholder; 33 | @property (nonatomic) UIColor *placeholderColor; 34 | 35 | @property (readonly) UILabel *placeHolderLabel; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Helpers/Views/XLFormTextView.m: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormTextView.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | 27 | #import "XLFormTextView.h" 28 | 29 | @implementation XLFormTextView 30 | 31 | - (void)dealloc 32 | { 33 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 34 | } 35 | 36 | - (id)initWithFrame:(CGRect)frame 37 | { 38 | if((self = [super initWithFrame:frame])){ 39 | self.scrollsToTop = NO; 40 | self.contentInset = UIEdgeInsetsMake(0, -4, 0, 0); 41 | [self setPlaceholder:@""]; 42 | [self setPlaceholderColor:[UIColor colorWithRed:.78 green:.78 blue:.80 alpha:1.0]]; 43 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textChanged:) name:UITextViewTextDidChangeNotification object:nil]; 44 | } 45 | return self; 46 | } 47 | 48 | - (void)textChanged:(NSNotification *)notification 49 | { 50 | if([[self placeholder] length] == 0){ 51 | return; 52 | } 53 | if([[self text] length] == 0){ 54 | [[self viewWithTag:999] setAlpha:1]; 55 | } 56 | else{ 57 | [[self viewWithTag:999] setAlpha:0]; 58 | } 59 | } 60 | 61 | - (void)setText:(NSString *)text { 62 | [super setText:text]; 63 | [self textChanged:nil]; 64 | } 65 | 66 | - (void)drawRect:(CGRect)rect 67 | { 68 | if([[self placeholder] length] > 0){ 69 | if (_placeHolderLabel == nil ){ 70 | _placeHolderLabel = [[UILabel alloc] initWithFrame:CGRectMake(4,8,self.bounds.size.width - 16,0)]; 71 | _placeHolderLabel.lineBreakMode = NSLineBreakByWordWrapping; 72 | _placeHolderLabel.numberOfLines = 0; 73 | _placeHolderLabel.backgroundColor = [UIColor clearColor]; 74 | _placeHolderLabel.textColor = self.placeholderColor; 75 | _placeHolderLabel.alpha = 0; 76 | _placeHolderLabel.tag = 999; 77 | [self addSubview:_placeHolderLabel]; 78 | } 79 | _placeHolderLabel.text = self.placeholder; 80 | _placeHolderLabel.font = self.font; 81 | [_placeHolderLabel sizeToFit]; 82 | [self sendSubviewToBack:_placeHolderLabel]; 83 | } 84 | if( [[self text] length] == 0 && [[self placeholder] length] > 0 ){ 85 | [[self viewWithTag:999] setAlpha:1]; 86 | } 87 | [super drawRect:rect]; 88 | } 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Validation/XLFormRegexValidator.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormRegexValidator.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormValidatorProtocol.h" 27 | #import "XLFormValidationStatus.h" 28 | #import "XLFormValidator.h" 29 | 30 | @interface XLFormRegexValidator : XLFormValidator 31 | 32 | @property NSString *msg; 33 | @property NSString *regex; 34 | 35 | - (id)initWithMsg:(NSString*)msg andRegexString:(NSString*)regex; 36 | + (XLFormRegexValidator *)formRegexValidatorWithMsg:(NSString *)msg regex:(NSString *)regex; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Validation/XLFormRegexValidator.m: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormRegexValidator.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormRegexValidator.h" 27 | 28 | @implementation XLFormRegexValidator 29 | 30 | -(id)initWithMsg:(NSString*)msg andRegexString:(NSString*)regex { 31 | self = [super init]; 32 | if (self) { 33 | self.msg = msg; 34 | self.regex = regex; 35 | } 36 | 37 | return self; 38 | } 39 | 40 | -(XLFormValidationStatus *)isValid: (XLFormRowDescriptor *)row { 41 | if (row != nil && row.value != nil) { 42 | // we only validate if there is a value 43 | // assumption: required validation is already triggered 44 | // if this field is optional, we only validate if there is a value 45 | id value = row.value; 46 | if ([value isKindOfClass:[NSNumber class]]){ 47 | value = [value stringValue]; 48 | } 49 | if ([value isKindOfClass:[NSString class]] && [value length] > 0) { 50 | BOOL isValid = [[NSPredicate predicateWithFormat:@"SELF MATCHES %@", self.regex] evaluateWithObject:[value stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]]; 51 | return [XLFormValidationStatus formValidationStatusWithMsg:self.msg status:isValid rowDescriptor:row]; 52 | } 53 | } 54 | return nil; 55 | }; 56 | 57 | +(XLFormRegexValidator *)formRegexValidatorWithMsg:(NSString *)msg regex:(NSString *)regex { 58 | return [[XLFormRegexValidator alloc] initWithMsg:msg andRegexString:regex]; 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Validation/XLFormValidationStatus.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormValidationStatus.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import 27 | 28 | #import "XLFormRowDescriptor.h" 29 | 30 | @interface XLFormValidationStatus : NSObject 31 | 32 | @property NSString *msg; 33 | @property BOOL isValid; 34 | @property (nonatomic, weak) XLFormRowDescriptor *rowDescriptor; 35 | 36 | //-(id)initWithMsg:(NSString*)msg andStatus:(BOOL)isValid; 37 | -(id)initWithMsg:(NSString*)msg status:(BOOL)isValid rowDescriptor:(XLFormRowDescriptor *)row; 38 | 39 | //+(XLFormValidationStatus *)formValidationStatusWithMsg:(NSString *)msg status:(BOOL)status; 40 | +(XLFormValidationStatus *)formValidationStatusWithMsg:(NSString *)msg status:(BOOL)status rowDescriptor:(XLFormRowDescriptor *)row; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Validation/XLFormValidationStatus.m: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormValidationStatus.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormValidationStatus.h" 27 | 28 | @implementation XLFormValidationStatus 29 | 30 | -(id)initWithMsg:(NSString*)msg andStatus:(BOOL)isValid { 31 | return [self initWithMsg:msg status:isValid rowDescriptor:nil]; 32 | } 33 | 34 | -(id)initWithMsg:(NSString*)msg status:(BOOL)isValid rowDescriptor:(XLFormRowDescriptor *)row { 35 | self = [super init]; 36 | if (self) { 37 | self.msg = msg; 38 | self.isValid = isValid; 39 | self.rowDescriptor = row; 40 | } 41 | 42 | return self; 43 | } 44 | 45 | +(XLFormValidationStatus *)formValidationStatusWithMsg:(NSString *)msg status:(BOOL)status { 46 | return [self formValidationStatusWithMsg:msg status:status rowDescriptor:nil]; 47 | } 48 | 49 | +(XLFormValidationStatus *)formValidationStatusWithMsg:(NSString *)msg status:(BOOL)status rowDescriptor:(XLFormRowDescriptor *)row { 50 | return [[XLFormValidationStatus alloc] initWithMsg:msg status:status rowDescriptor:row]; 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Validation/XLFormValidator.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormValidator.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | 27 | #import "XLFormValidatorProtocol.h" 28 | 29 | @interface XLFormValidator : NSObject 30 | 31 | +(XLFormValidator *)emailValidator; 32 | +(XLFormValidator *)emailValidatorLong; 33 | @end 34 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Validation/XLFormValidator.m: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormValidator.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormValidationStatus.h" 27 | #import "XLFormRegexValidator.h" 28 | 29 | #import "XLFormValidator.h" 30 | 31 | @implementation XLFormValidator 32 | 33 | -(XLFormValidationStatus *)isValid:(XLFormRowDescriptor *)row 34 | { 35 | return [XLFormValidationStatus formValidationStatusWithMsg:nil status:YES rowDescriptor:row]; 36 | } 37 | 38 | #pragma mark - Validators 39 | 40 | 41 | +(XLFormValidator *)emailValidator 42 | { 43 | return [XLFormRegexValidator formRegexValidatorWithMsg:NSLocalizedString(@"Invalid email address", nil) regex:@"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"]; 44 | } 45 | +(XLFormValidator *)emailValidatorLong 46 | { 47 | return [XLFormRegexValidator formRegexValidatorWithMsg:NSLocalizedString(@"Invalid email address", nil) regex:@"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,11}"]; 48 | } 49 | @end 50 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/Validation/XLFormValidatorProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLFormValidatorProtocol.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import "XLFormRowDescriptor.h" 27 | 28 | @class XLFormValidationStatus; 29 | 30 | @protocol XLFormValidatorProtocol 31 | 32 | @required 33 | 34 | -(XLFormValidationStatus *)isValid:(XLFormRowDescriptor *)row; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/XLForm.h: -------------------------------------------------------------------------------- 1 | // 2 | // XLForm.h 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | #import 27 | 28 | //Descriptors 29 | #import "XLFormDescriptor.h" 30 | #import "XLFormRowDescriptor.h" 31 | #import "XLFormSectionDescriptor.h" 32 | 33 | // Categories 34 | #import "NSArray+XLFormAdditions.h" 35 | #import "NSExpression+XLFormAdditions.h" 36 | #import "NSObject+XLFormAdditions.h" 37 | #import "NSPredicate+XLFormAdditions.h" 38 | #import "NSString+XLFormAdditions.h" 39 | #import "UIView+XLFormAdditions.h" 40 | 41 | //helpers 42 | #import "XLFormOptionsObject.h" 43 | 44 | //Controllers 45 | #import "XLFormOptionsViewController.h" 46 | #import "XLFormViewController.h" 47 | 48 | //Protocols 49 | #import "XLFormDescriptorCell.h" 50 | #import "XLFormInlineRowDescriptorCell.h" 51 | #import "XLFormRowDescriptorViewController.h" 52 | 53 | //Cells 54 | #import "XLFormBaseCell.h" 55 | #import "XLFormButtonCell.h" 56 | #import "XLFormCheckCell.h" 57 | #import "XLFormDateCell.h" 58 | #import "XLFormDatePickerCell.h" 59 | #import "XLFormInlineSelectorCell.h" 60 | #import "XLFormLeftRightSelectorCell.h" 61 | #import "XLFormPickerCell.h" 62 | #import "XLFormRightDetailCell.h" 63 | #import "XLFormRightImageButton.h" 64 | #import "XLFormSegmentedCell.h" 65 | #import "XLFormSelectorCell.h" 66 | #import "XLFormSliderCell.h" 67 | #import "XLFormStepCounterCell.h" 68 | #import "XLFormSwitchCell.h" 69 | #import "XLFormTextFieldCell.h" 70 | #import "XLFormTextViewCell.h" 71 | #import "XLFormImageCell.h" 72 | 73 | //Validation 74 | #import "XLFormRegexValidator.h" 75 | 76 | 77 | extern NSString *const XLFormRowDescriptorTypeAccount; 78 | extern NSString *const XLFormRowDescriptorTypeBooleanCheck; 79 | extern NSString *const XLFormRowDescriptorTypeBooleanSwitch; 80 | extern NSString *const XLFormRowDescriptorTypeButton; 81 | extern NSString *const XLFormRowDescriptorTypeCountDownTimer; 82 | extern NSString *const XLFormRowDescriptorTypeCountDownTimerInline; 83 | extern NSString *const XLFormRowDescriptorTypeDate; 84 | extern NSString *const XLFormRowDescriptorTypeDateInline; 85 | extern NSString *const XLFormRowDescriptorTypeDatePicker; 86 | extern NSString *const XLFormRowDescriptorTypeDateTime; 87 | extern NSString *const XLFormRowDescriptorTypeDateTimeInline; 88 | extern NSString *const XLFormRowDescriptorTypeDecimal; 89 | extern NSString *const XLFormRowDescriptorTypeEmail; 90 | extern NSString *const XLFormRowDescriptorTypeImage; 91 | extern NSString *const XLFormRowDescriptorTypeInfo; 92 | extern NSString *const XLFormRowDescriptorTypeInteger; 93 | extern NSString *const XLFormRowDescriptorTypeMultipleSelector; 94 | extern NSString *const XLFormRowDescriptorTypeMultipleSelectorPopover; 95 | extern NSString *const XLFormRowDescriptorTypeName; 96 | extern NSString *const XLFormRowDescriptorTypeNumber; 97 | extern NSString *const XLFormRowDescriptorTypePassword; 98 | extern NSString *const XLFormRowDescriptorTypePhone; 99 | extern NSString *const XLFormRowDescriptorTypePicker; 100 | extern NSString *const XLFormRowDescriptorTypeSelectorActionSheet; 101 | extern NSString *const XLFormRowDescriptorTypeSelectorAlertView; 102 | extern NSString *const XLFormRowDescriptorTypeSelectorLeftRight; 103 | extern NSString *const XLFormRowDescriptorTypeSelectorPickerView; 104 | extern NSString *const XLFormRowDescriptorTypeSelectorPickerViewInline; 105 | extern NSString *const XLFormRowDescriptorTypeSelectorPopover; 106 | extern NSString *const XLFormRowDescriptorTypeSelectorPush; 107 | extern NSString *const XLFormRowDescriptorTypeSelectorSegmentedControl; 108 | extern NSString *const XLFormRowDescriptorTypeSlider; 109 | extern NSString *const XLFormRowDescriptorTypeStepCounter; 110 | extern NSString *const XLFormRowDescriptorTypeText; 111 | extern NSString *const XLFormRowDescriptorTypeTextView; 112 | extern NSString *const XLFormRowDescriptorTypeTime; 113 | extern NSString *const XLFormRowDescriptorTypeTimeInline; 114 | extern NSString *const XLFormRowDescriptorTypeTwitter; 115 | extern NSString *const XLFormRowDescriptorTypeURL; 116 | extern NSString *const XLFormRowDescriptorTypeZipCode; 117 | 118 | 119 | #define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame) 120 | #define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending) 121 | #define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) 122 | #define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) 123 | #define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending 124 | 125 | 126 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XL/XLForm.m: -------------------------------------------------------------------------------- 1 | // 2 | // XLForm.m 3 | // XLForm ( https://github.com/xmartlabs/XLForm ) 4 | // 5 | // Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com ) 6 | // 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 | 27 | #import "XLForm.h" 28 | 29 | NSString *const XLFormRowDescriptorTypeText = @"text"; 30 | NSString *const XLFormRowDescriptorTypeName = @"name"; 31 | NSString *const XLFormRowDescriptorTypeURL = @"url"; 32 | NSString *const XLFormRowDescriptorTypeEmail = @"email"; 33 | NSString *const XLFormRowDescriptorTypePassword = @"password"; 34 | NSString *const XLFormRowDescriptorTypeNumber = @"number"; 35 | NSString *const XLFormRowDescriptorTypePhone = @"phone"; 36 | NSString *const XLFormRowDescriptorTypeTwitter = @"twitter"; 37 | NSString *const XLFormRowDescriptorTypeAccount = @"account"; 38 | NSString *const XLFormRowDescriptorTypeInteger = @"integer"; 39 | NSString *const XLFormRowDescriptorTypeImage = @"image"; 40 | NSString *const XLFormRowDescriptorTypeDecimal = @"decimal"; 41 | NSString *const XLFormRowDescriptorTypeTextView = @"textView"; 42 | NSString *const XLFormRowDescriptorTypeZipCode = @"zipCode"; 43 | NSString *const XLFormRowDescriptorTypeSelectorPush = @"selectorPush"; 44 | NSString *const XLFormRowDescriptorTypeSelectorPopover = @"selectorPopover"; 45 | NSString *const XLFormRowDescriptorTypeSelectorActionSheet = @"selectorActionSheet"; 46 | NSString *const XLFormRowDescriptorTypeSelectorAlertView = @"selectorAlertView"; 47 | NSString *const XLFormRowDescriptorTypeSelectorPickerView = @"selectorPickerView"; 48 | NSString *const XLFormRowDescriptorTypeSelectorPickerViewInline = @"selectorPickerViewInline"; 49 | NSString *const XLFormRowDescriptorTypeMultipleSelector = @"multipleSelector"; 50 | NSString *const XLFormRowDescriptorTypeMultipleSelectorPopover = @"multipleSelectorPopover"; 51 | NSString *const XLFormRowDescriptorTypeSelectorLeftRight = @"selectorLeftRight"; 52 | NSString *const XLFormRowDescriptorTypeSelectorSegmentedControl = @"selectorSegmentedControl"; 53 | NSString *const XLFormRowDescriptorTypeDateInline = @"dateInline"; 54 | NSString *const XLFormRowDescriptorTypeDateTimeInline = @"datetimeInline"; 55 | NSString *const XLFormRowDescriptorTypeTimeInline = @"timeInline"; 56 | NSString *const XLFormRowDescriptorTypeCountDownTimerInline = @"countDownTimerInline"; 57 | NSString *const XLFormRowDescriptorTypeDate = @"date"; 58 | NSString *const XLFormRowDescriptorTypeDateTime = @"datetime"; 59 | NSString *const XLFormRowDescriptorTypeTime = @"time"; 60 | NSString *const XLFormRowDescriptorTypeCountDownTimer = @"countDownTimer"; 61 | NSString *const XLFormRowDescriptorTypeDatePicker = @"datePicker"; 62 | NSString *const XLFormRowDescriptorTypePicker = @"picker"; 63 | NSString *const XLFormRowDescriptorTypeSlider = @"slider"; 64 | NSString *const XLFormRowDescriptorTypeBooleanCheck = @"booleanCheck"; 65 | NSString *const XLFormRowDescriptorTypeBooleanSwitch = @"booleanSwitch"; 66 | NSString *const XLFormRowDescriptorTypeButton = @"button"; 67 | NSString *const XLFormRowDescriptorTypeInfo = @"info"; 68 | NSString *const XLFormRowDescriptorTypeStepCounter = @"stepCounter"; 69 | 70 | -------------------------------------------------------------------------------- /Demo/Pods/XLForm/XLForm/XLForm.bundle/forwardarrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kronik/ScalePicker/5e59efe4a8d1421c3e80c1cd5fe12c9635662d70/Demo/Pods/XLForm/XLForm/XLForm.bundle/forwardarrow@2x.png -------------------------------------------------------------------------------- /Demo/ScalePicker/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // ScalePicker 4 | // 5 | // Created by Dmitry on 14/3/16. 6 | // Copyright © 2016 Dmitry Klimkin. 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: [NSObject: AnyObject]?) -> Bool { 18 | // Override point for customization after application launch. 19 | 20 | let controller = createRootViewController() 21 | 22 | self.window = UIWindow(frame: UIScreen.mainScreen().bounds) 23 | self.window!.backgroundColor = controller.view.backgroundColor 24 | self.window!.rootViewController = controller 25 | 26 | self.window!.makeKeyAndVisible() 27 | 28 | return true 29 | } 30 | 31 | func createRootViewController() -> UIViewController { 32 | return ViewController() 33 | } 34 | 35 | 36 | func applicationWillResignActive(application: UIApplication) { 37 | // 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. 38 | // 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. 39 | } 40 | 41 | func applicationDidEnterBackground(application: UIApplication) { 42 | // 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. 43 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 44 | } 45 | 46 | func applicationWillEnterForeground(application: UIApplication) { 47 | // 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. 48 | } 49 | 50 | func applicationDidBecomeActive(application: UIApplication) { 51 | // 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. 52 | } 53 | 54 | func applicationWillTerminate(application: UIApplication) { 55 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 56 | } 57 | 58 | 59 | } 60 | 61 | -------------------------------------------------------------------------------- /Demo/ScalePicker/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 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Demo/ScalePicker/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Demo/ScalePicker/Assets.xcassets/arrowPointer.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "arrow_pointer@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "arrow_pointer@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Demo/ScalePicker/Assets.xcassets/arrowPointer.imageset/arrow_pointer@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kronik/ScalePicker/5e59efe4a8d1421c3e80c1cd5fe12c9635662d70/Demo/ScalePicker/Assets.xcassets/arrowPointer.imageset/arrow_pointer@2x.png -------------------------------------------------------------------------------- /Demo/ScalePicker/Assets.xcassets/arrowPointer.imageset/arrow_pointer@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kronik/ScalePicker/5e59efe4a8d1421c3e80c1cd5fe12c9635662d70/Demo/ScalePicker/Assets.xcassets/arrowPointer.imageset/arrow_pointer@3x.png -------------------------------------------------------------------------------- /Demo/ScalePicker/Assets.xcassets/speedAuto.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "shutter_speed_auto_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "shutter_speed_auto_normal@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Demo/ScalePicker/Assets.xcassets/speedAuto.imageset/shutter_speed_auto_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kronik/ScalePicker/5e59efe4a8d1421c3e80c1cd5fe12c9635662d70/Demo/ScalePicker/Assets.xcassets/speedAuto.imageset/shutter_speed_auto_normal@2x.png -------------------------------------------------------------------------------- /Demo/ScalePicker/Assets.xcassets/speedAuto.imageset/shutter_speed_auto_normal@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kronik/ScalePicker/5e59efe4a8d1421c3e80c1cd5fe12c9635662d70/Demo/ScalePicker/Assets.xcassets/speedAuto.imageset/shutter_speed_auto_normal@3x.png -------------------------------------------------------------------------------- /Demo/ScalePicker/Assets.xcassets/speedManual.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "shutter_speed_manual_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "shutter_speed_manual_normal@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Demo/ScalePicker/Assets.xcassets/speedManual.imageset/shutter_speed_manual_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kronik/ScalePicker/5e59efe4a8d1421c3e80c1cd5fe12c9635662d70/Demo/ScalePicker/Assets.xcassets/speedManual.imageset/shutter_speed_manual_normal@2x.png -------------------------------------------------------------------------------- /Demo/ScalePicker/Assets.xcassets/speedManual.imageset/shutter_speed_manual_normal@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kronik/ScalePicker/5e59efe4a8d1421c3e80c1cd5fe12c9635662d70/Demo/ScalePicker/Assets.xcassets/speedManual.imageset/shutter_speed_manual_normal@3x.png -------------------------------------------------------------------------------- /Demo/ScalePicker/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 | -------------------------------------------------------------------------------- /Demo/ScalePicker/DemoView.xib: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /Demo/ScalePicker/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 | 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UIRequiresFullScreen 34 | 35 | UIStatusBarHidden 36 | 37 | UIStatusBarStyle 38 | UIStatusBarStyleLightContent 39 | UISupportedInterfaceOrientations 40 | 41 | UIInterfaceOrientationPortrait 42 | 43 | UIViewControllerBasedStatusBarAppearance 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /Demo/ScalePicker/ScalePicker-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | #ifndef ScalePicker_Bridging_Header_h 6 | #define ScalePicker_Bridging_Header_h 7 | 8 | #import 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /Demo/ScalePicker/Utils.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Utils.swift 3 | // ScalePicker 4 | // 5 | // Created by Dmitry on 14/3/16. 6 | // Copyright © 2016 Dmitry Klimkin. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | struct Utils { 13 | static let ScreenWidth = UIScreen.mainScreen().bounds.size.width 14 | static let ScreenHeight = UIScreen.mainScreen().bounds.size.height 15 | static let BackgroundColor = UIColor(red:0.13, green:0.13, blue:0.13, alpha:1) 16 | } -------------------------------------------------------------------------------- /Demo/ScalePickerDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Demo/ScalePickerDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Dmitry Klimkin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | Platform: iOS 8+ 4 | 5 | Language: Swift 2.2 6 | Carthage compatible 7 | License: MIT 8 | 9 |

10 | 11 | # ScalePicker 12 | 13 | Generic scale and a handy float-value picker for any iOS app. 14 | 15 | ## Preview 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | ## Installation 25 | 26 | ### With source code 27 | 28 | [Download repository](https://github.com/kronik/ScalePicker/archive/master.zip), then add [ScalePicker directory](https://github.com/kronik/ScalePicker/blob/master/ScalePicker/) to your project. 29 | 30 | ### With CocoaPods 31 | 32 | CocoaPods is a dependency manager for Objective-C/Swift, which automates and simplifies the process of using 3rd-party libraries in your projects. To install with cocoaPods, follow the "Get Started" section on [CocoaPods](https://cocoapods.org/). 33 | 34 | #### Podfile 35 | ```ruby 36 | platform :ios, '8.0' 37 | use_frameworks! 38 | 39 | pod 'ScalePicker' 40 | ``` 41 | 42 | ### With Carthage 43 | 44 | Carthage is a lightweight dependency manager for Swift and Objective-C. It leverages CocoaTouch modules and is less invasive than CocoaPods. To install with carthage, follow the instruction on [Carthage](https://github.com/Carthage/Carthage/). 45 | 46 | You can install Carthage with [Homebrew](http://brew.sh/) using the following command: 47 | 48 | ```bash 49 | $ brew update 50 | $ brew install carthage 51 | ``` 52 | To integrate ScalePicker into your Xcode project using Carthage, specify it in your `Cartfile`: 53 | 54 | ```ogdl 55 | github "kronik/ScalePicker" 56 | ``` 57 | 58 | ## Usage 59 | 60 | ### Initialisation 61 | 62 | Instantiate scale view with preferred frame: 63 | 64 | ```swift 65 | let screenWidth = UIScreen.mainScreen().bounds.size.width 66 | let scaleView = ScalePicker(frame: CGRectMake(0, 0, screenWidth, 50)) 67 | 68 | view.addSubview(scaleView) 69 | ``` 70 | 71 | ### Properties 72 | 73 | ####Set minimum value 74 | 75 | ```swift 76 | scaleView.minValue = -3.0 77 | ``` 78 | 79 | ####Set maximum value 80 | 81 | ```swift 82 | scaleView.maxValue = 3.0 83 | ``` 84 | 85 | ####Set number of ticks between values value 86 | 87 | ```swift 88 | scaleView.numberOfTicksBetweenValues = 2 89 | ``` 90 | 91 | ####Set space between ticks 92 | 93 | ```swift 94 | scaleView.spaceBetweenTicks = 20.0 95 | ``` 96 | 97 | ####Set tick label visibility 98 | 99 | ```swift 100 | scaleView.showTickLabels = true 101 | ``` 102 | 103 | ####Set a delegate 104 | 105 | ```swift 106 | scaleView.delegate = self 107 | ``` 108 | 109 | ####Set ability to snap to the nearest value 110 | 111 | ```swift 112 | scaleView.snapEnabled = true 113 | ``` 114 | 115 | ####Set bounces value 116 | 117 | ```swift 118 | scaleView.bounces = false 119 | ``` 120 | 121 | ####Set tick (and center/arrow view) color 122 | 123 | ```swift 124 | scaleView.tickColor = UIColor.whiteColor() 125 | ``` 126 | 127 | ####Set center/arrow image 128 | 129 | ```swift 130 | scaleView.centerArrowImage = UIImage(named: "arrowPointer") 131 | ``` 132 | 133 | ### Control actions 134 | #### Increase current value 135 | 136 | ```swift 137 | scaleView.increaseValue() 138 | ``` 139 | #### Decrease current value 140 | 141 | ```swift 142 | scaleView.decreaseValue() 143 | ``` 144 | #### Reset current value 145 | 146 | ```swift 147 | scaleView.reset() 148 | ``` 149 | #### Gestures 150 | In addition to increase/decrease/reset actions ScaleView allows you to double tap to trigger reset action 151 | 152 | ### More 153 | 154 | For more details try Xcode [Demo project](https://github.com/kronik/ScalePicker/blob/master/Demo) 155 | 156 | # Etc. 157 | 158 | * Contributions are very welcome. 159 | * Attribution is appreciated (let's spread the word!), but not mandatory. 160 | 161 | ## Use it? Love/hate it? 162 | 163 | Tweet the author [@dklimkin](http://twitter.com/dklimkin), and check out Dmitry's portfolio: http://dmitry-klimkin.com 164 | 165 | ## License 166 | 167 | ScalePicker is released under the MIT license. See [LICENSE](https://raw.githubusercontent.com/kronik/ScalePicker/master/LICENSE) for details. 168 | -------------------------------------------------------------------------------- /ScalePicker.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | s.name = 'ScalePicker' 4 | s.version = '2.7.11' 5 | s.platform = :ios, '8.0' 6 | s.license = 'MIT' 7 | s.homepage = 'https://github.com/kronik/ScalePicker' 8 | s.author = { 'Dmitry Klimkin' => 'dmitry.klimkin@gmail.com' } 9 | s.source = { :git => 'https://github.com/kronik/ScalePicker.git', :tag => s.version } 10 | s.summary = 'Generic scale and a float value picker for any iOS app' 11 | s.ios.deployment_target = '8.0' 12 | s.framework = 'UIKit' 13 | s.requires_arc = true 14 | 15 | s.source_files = 'ScalePicker/*.swift' 16 | 17 | end 18 | -------------------------------------------------------------------------------- /ScalePicker.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ScalePicker.xcodeproj/xcshareddata/xcschemes/ScalePicker.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 | -------------------------------------------------------------------------------- /ScalePicker/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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ScalePicker/ScalePicker.h: -------------------------------------------------------------------------------- 1 | // 2 | // ScalePicker.h 3 | // ScalePicker 4 | // 5 | // Created by Dmitry on 15/3/16. 6 | // Copyright © 2016 Dmitry Klimkin. All rights reserved. 7 | // 8 | 9 | @import Foundation; 10 | 11 | //! Project version number for ScalePicker. 12 | FOUNDATION_EXPORT double ScalePickerVersionNumber; 13 | 14 | //! Project version string for ScalePicker. 15 | FOUNDATION_EXPORT const unsigned char ScalePickerVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /ScalePicker/SlidePickerFlowLayout.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SlidePickerFlowLayout.swift 3 | // Dmitry Klimkin 4 | // 5 | // Created by Dmitry Klimkin on 15/3/16. 6 | // Copyright © 2016 Dmitry Klimkin. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | public class SlidePickerFlowLayout: UICollectionViewFlowLayout { 13 | 14 | } -------------------------------------------------------------------------------- /Screenshots/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kronik/ScalePicker/5e59efe4a8d1421c3e80c1cd5fe12c9635662d70/Screenshots/1.jpg -------------------------------------------------------------------------------- /Screenshots/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kronik/ScalePicker/5e59efe4a8d1421c3e80c1cd5fe12c9635662d70/Screenshots/1.png -------------------------------------------------------------------------------- /Screenshots/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kronik/ScalePicker/5e59efe4a8d1421c3e80c1cd5fe12c9635662d70/Screenshots/2.png -------------------------------------------------------------------------------- /Screenshots/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kronik/ScalePicker/5e59efe4a8d1421c3e80c1cd5fe12c9635662d70/Screenshots/3.png -------------------------------------------------------------------------------- /Screenshots/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kronik/ScalePicker/5e59efe4a8d1421c3e80c1cd5fe12c9635662d70/Screenshots/demo.gif --------------------------------------------------------------------------------