├── Pod ├── Assets │ └── .gitkeep └── Classes │ └── .gitkeep ├── Example ├── .idea │ ├── .name │ ├── xcode.xml │ ├── encodings.xml │ ├── vcs.xml │ ├── modules.xml │ ├── runConfigurations │ │ ├── EurekaCreditCard.xml │ │ └── EurekaCreditCard_Example.xml │ └── misc.xml ├── Pods │ ├── Target Support Files │ │ ├── Eureka │ │ │ ├── Eureka-prefix.pch │ │ │ ├── Eureka.modulemap │ │ │ ├── Eureka-dummy.m │ │ │ ├── Eureka-umbrella.h │ │ │ ├── Eureka.xcconfig │ │ │ └── Info.plist │ │ ├── BKMoneyKit │ │ │ ├── BKMoneyKit-prefix.pch │ │ │ ├── BKMoneyKit.modulemap │ │ │ ├── BKMoneyKit-dummy.m │ │ │ ├── BKMoneyKit-umbrella.h │ │ │ ├── BKMoneyKit.xcconfig │ │ │ ├── ResourceBundle-BKMoneyKit-Info.plist │ │ │ └── Info.plist │ │ ├── EurekaCreditCard │ │ │ ├── EurekaCreditCard-prefix.pch │ │ │ ├── EurekaCreditCard.modulemap │ │ │ ├── EurekaCreditCard-dummy.m │ │ │ ├── EurekaCreditCard-umbrella.h │ │ │ ├── EurekaCreditCard.xcconfig │ │ │ ├── ResourceBundle-EurekaCreditCard-Info.plist │ │ │ └── Info.plist │ │ ├── FBSnapshotTestCase │ │ │ ├── FBSnapshotTestCase-prefix.pch │ │ │ ├── FBSnapshotTestCase.modulemap │ │ │ ├── FBSnapshotTestCase-dummy.m │ │ │ ├── FBSnapshotTestCase-umbrella.h │ │ │ ├── FBSnapshotTestCase.xcconfig │ │ │ └── Info.plist │ │ ├── Pods-BasePods-EurekaCreditCard_Tests │ │ │ ├── Pods-BasePods-EurekaCreditCard_Tests.modulemap │ │ │ ├── Pods-BasePods-EurekaCreditCard_Tests-dummy.m │ │ │ ├── Pods-BasePods-EurekaCreditCard_Tests-umbrella.h │ │ │ ├── Info.plist │ │ │ ├── Pods-BasePods-EurekaCreditCard_Tests.debug.xcconfig │ │ │ ├── Pods-BasePods-EurekaCreditCard_Tests.release.xcconfig │ │ │ └── Pods-BasePods-EurekaCreditCard_Tests-frameworks.sh │ │ └── Pods-BasePods-EurekaCreditCard_Example │ │ │ ├── Pods-BasePods-EurekaCreditCard_Example.modulemap │ │ │ ├── Pods-BasePods-EurekaCreditCard_Example-dummy.m │ │ │ ├── Pods-BasePods-EurekaCreditCard_Example-umbrella.h │ │ │ ├── Info.plist │ │ │ ├── Pods-BasePods-EurekaCreditCard_Example.debug.xcconfig │ │ │ ├── Pods-BasePods-EurekaCreditCard_Example.release.xcconfig │ │ │ ├── Pods-BasePods-EurekaCreditCard_Example-acknowledgements.markdown │ │ │ └── Pods-BasePods-EurekaCreditCard_Example-frameworks.sh │ ├── BKMoneyKit │ │ ├── BKMoneyKit │ │ │ ├── BKMoneyKit.bundle │ │ │ │ ├── CardLogo │ │ │ │ │ ├── jcb@2x.png │ │ │ │ │ ├── amex@2x.png │ │ │ │ │ ├── laser@2x.png │ │ │ │ │ ├── visa@2x.png │ │ │ │ │ ├── default@2x.png │ │ │ │ │ ├── discover@2x.png │ │ │ │ │ ├── maestro@2x.png │ │ │ │ │ ├── mastercard@2x.png │ │ │ │ │ └── dinersclubintl@2x.png │ │ │ │ └── CardPatterns.plist │ │ │ ├── BKForwardingTextField.h │ │ │ ├── BKMoneyUtils.h │ │ │ ├── BKCardExpiryField.h │ │ │ ├── BKCurrencyTextField.h │ │ │ ├── BKCardNumberLabel.h │ │ │ ├── BKCardNumberField.h │ │ │ ├── BKCardPatternInfo.h │ │ │ ├── BKMoneyUtils.m │ │ │ ├── BKCardNumberFormatter.h │ │ │ ├── BKForwardingTextField.m │ │ │ ├── BKCardNumberLabel.m │ │ │ ├── BKCardNumberFormatter.m │ │ │ └── BKCardPatternInfo.m │ │ ├── LICENSE │ │ └── README.md │ ├── Eureka │ │ ├── Source │ │ │ ├── Resources │ │ │ │ └── Eureka.bundle │ │ │ │ │ ├── back-chevron@1x.png │ │ │ │ │ ├── back-chevron@2x.png │ │ │ │ │ ├── back-chevron@3x.png │ │ │ │ │ ├── forward-chevron@1x.png │ │ │ │ │ ├── forward-chevron@2x.png │ │ │ │ │ └── forward-chevron@3x.png │ │ │ ├── Rows │ │ │ │ ├── Common │ │ │ │ │ ├── OptionsRow.swift │ │ │ │ │ ├── DecimalFormatter.swift │ │ │ │ │ ├── Protocols.swift │ │ │ │ │ ├── DateInlineFieldRow.swift │ │ │ │ │ ├── SelectorRow.swift │ │ │ │ │ ├── GenericMultipleSelectorRow.swift │ │ │ │ │ └── DateFieldRow.swift │ │ │ │ ├── MultipleSelectorRow.swift │ │ │ │ ├── PushRow.swift │ │ │ │ ├── LabelRow.swift │ │ │ │ ├── Controllers │ │ │ │ │ ├── ImagePickerController.swift │ │ │ │ │ ├── SelectorAlertController.swift │ │ │ │ │ ├── SelectorViewController.swift │ │ │ │ │ └── MultipleSelectorViewController.swift │ │ │ │ ├── PopoverSelectorRow.swift │ │ │ │ ├── SelectableRows │ │ │ │ │ └── ListCheckRow.swift │ │ │ │ ├── SwitchRow.swift │ │ │ │ ├── CheckRow.swift │ │ │ │ ├── AlertRow.swift │ │ │ │ ├── PickerInlineRow.swift │ │ │ │ ├── StepperRow.swift │ │ │ │ ├── PickerRow.swift │ │ │ │ ├── ActionSheetRow.swift │ │ │ │ ├── ButtonRow.swift │ │ │ │ ├── ButtonRowWithPresent.swift │ │ │ │ ├── DatePickerRow.swift │ │ │ │ └── DateRow.swift │ │ │ └── Core │ │ │ │ ├── SelectableRowType.swift │ │ │ │ ├── RowControllerType.swift │ │ │ │ ├── PresenterRowType.swift │ │ │ │ ├── RowProtocols.swift │ │ │ │ ├── CellType.swift │ │ │ │ ├── Helpers.swift │ │ │ │ └── NavigationAccessoryView.swift │ │ └── LICENSE │ ├── FBSnapshotTestCase │ │ ├── FBSnapshotTestCase │ │ │ ├── Categories │ │ │ │ ├── UIApplication+StrictKeyWindow.h │ │ │ │ ├── UIImage+Snapshot.h │ │ │ │ ├── UIApplication+StrictKeyWindow.m │ │ │ │ ├── UIImage+Diff.h │ │ │ │ ├── UIImage+Compare.h │ │ │ │ ├── UIImage+Snapshot.m │ │ │ │ └── UIImage+Diff.m │ │ │ ├── FBSnapshotTestCasePlatform.h │ │ │ ├── FBSnapshotTestCasePlatform.m │ │ │ └── SwiftSupport.swift │ │ ├── LICENSE │ │ └── README.md │ ├── Local Podspecs │ │ ├── Eureka.podspec.json │ │ └── EurekaCreditCard.podspec.json │ ├── Manifest.lock │ └── Pods.xcodeproj │ │ └── xcshareddata │ │ └── xcschemes │ │ └── EurekaCreditCard.xcscheme ├── EurekaCreditCard.xcodeproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── EurekaCreditCard.xcworkspace │ └── contents.xcworkspacedata ├── Podfile ├── EurekaCreditCard │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.xib │ ├── AppDelegate.swift │ └── ViewController.swift ├── Tests │ ├── Info.plist │ └── Tests.swift └── Podfile.lock ├── _Pods.xcodeproj ├── demo_selector.png ├── demo_styles.png ├── .travis.yml ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── EurekaCreditCard.podspec └── README.md /Pod/Assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Pod/Classes/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Example/.idea/.name: -------------------------------------------------------------------------------- 1 | EurekaCreditCard -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj -------------------------------------------------------------------------------- /demo_selector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/demetrio812/EurekaCreditCard/HEAD/demo_selector.png -------------------------------------------------------------------------------- /demo_styles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/demetrio812/EurekaCreditCard/HEAD/demo_styles.png -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Eureka/Eureka-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/BKMoneyKit/BKMoneyKit-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/EurekaCreditCard/EurekaCreditCard-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Eureka/Eureka.modulemap: -------------------------------------------------------------------------------- 1 | framework module Eureka { 2 | umbrella header "Eureka-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Eureka/Eureka-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Eureka : NSObject 3 | @end 4 | @implementation PodsDummy_Eureka 5 | @end 6 | -------------------------------------------------------------------------------- /Example/.idea/xcode.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/BKMoneyKit/BKMoneyKit.modulemap: -------------------------------------------------------------------------------- 1 | framework module BKMoneyKit { 2 | umbrella header "BKMoneyKit-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Example/Pods/BKMoneyKit/BKMoneyKit/BKMoneyKit.bundle/CardLogo/jcb@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/demetrio812/EurekaCreditCard/HEAD/Example/Pods/BKMoneyKit/BKMoneyKit/BKMoneyKit.bundle/CardLogo/jcb@2x.png -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Resources/Eureka.bundle/back-chevron@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/demetrio812/EurekaCreditCard/HEAD/Example/Pods/Eureka/Source/Resources/Eureka.bundle/back-chevron@1x.png -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Resources/Eureka.bundle/back-chevron@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/demetrio812/EurekaCreditCard/HEAD/Example/Pods/Eureka/Source/Resources/Eureka.bundle/back-chevron@2x.png -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Resources/Eureka.bundle/back-chevron@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/demetrio812/EurekaCreditCard/HEAD/Example/Pods/Eureka/Source/Resources/Eureka.bundle/back-chevron@3x.png -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/BKMoneyKit/BKMoneyKit-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_BKMoneyKit : NSObject 3 | @end 4 | @implementation PodsDummy_BKMoneyKit 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/BKMoneyKit/BKMoneyKit/BKMoneyKit.bundle/CardLogo/amex@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/demetrio812/EurekaCreditCard/HEAD/Example/Pods/BKMoneyKit/BKMoneyKit/BKMoneyKit.bundle/CardLogo/amex@2x.png -------------------------------------------------------------------------------- /Example/Pods/BKMoneyKit/BKMoneyKit/BKMoneyKit.bundle/CardLogo/laser@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/demetrio812/EurekaCreditCard/HEAD/Example/Pods/BKMoneyKit/BKMoneyKit/BKMoneyKit.bundle/CardLogo/laser@2x.png -------------------------------------------------------------------------------- /Example/Pods/BKMoneyKit/BKMoneyKit/BKMoneyKit.bundle/CardLogo/visa@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/demetrio812/EurekaCreditCard/HEAD/Example/Pods/BKMoneyKit/BKMoneyKit/BKMoneyKit.bundle/CardLogo/visa@2x.png -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Resources/Eureka.bundle/forward-chevron@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/demetrio812/EurekaCreditCard/HEAD/Example/Pods/Eureka/Source/Resources/Eureka.bundle/forward-chevron@1x.png -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Resources/Eureka.bundle/forward-chevron@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/demetrio812/EurekaCreditCard/HEAD/Example/Pods/Eureka/Source/Resources/Eureka.bundle/forward-chevron@2x.png -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Resources/Eureka.bundle/forward-chevron@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/demetrio812/EurekaCreditCard/HEAD/Example/Pods/Eureka/Source/Resources/Eureka.bundle/forward-chevron@3x.png -------------------------------------------------------------------------------- /Example/Pods/BKMoneyKit/BKMoneyKit/BKMoneyKit.bundle/CardLogo/default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/demetrio812/EurekaCreditCard/HEAD/Example/Pods/BKMoneyKit/BKMoneyKit/BKMoneyKit.bundle/CardLogo/default@2x.png -------------------------------------------------------------------------------- /Example/Pods/BKMoneyKit/BKMoneyKit/BKMoneyKit.bundle/CardLogo/discover@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/demetrio812/EurekaCreditCard/HEAD/Example/Pods/BKMoneyKit/BKMoneyKit/BKMoneyKit.bundle/CardLogo/discover@2x.png -------------------------------------------------------------------------------- /Example/Pods/BKMoneyKit/BKMoneyKit/BKMoneyKit.bundle/CardLogo/maestro@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/demetrio812/EurekaCreditCard/HEAD/Example/Pods/BKMoneyKit/BKMoneyKit/BKMoneyKit.bundle/CardLogo/maestro@2x.png -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Eureka/Eureka-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double EurekaVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char EurekaVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Example/Pods/BKMoneyKit/BKMoneyKit/BKMoneyKit.bundle/CardLogo/mastercard@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/demetrio812/EurekaCreditCard/HEAD/Example/Pods/BKMoneyKit/BKMoneyKit/BKMoneyKit.bundle/CardLogo/mastercard@2x.png -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/EurekaCreditCard/EurekaCreditCard.modulemap: -------------------------------------------------------------------------------- 1 | framework module EurekaCreditCard { 2 | umbrella header "EurekaCreditCard-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Example/Pods/BKMoneyKit/BKMoneyKit/BKMoneyKit.bundle/CardLogo/dinersclubintl@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/demetrio812/EurekaCreditCard/HEAD/Example/Pods/BKMoneyKit/BKMoneyKit/BKMoneyKit.bundle/CardLogo/dinersclubintl@2x.png -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/EurekaCreditCard/EurekaCreditCard-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_EurekaCreditCard : NSObject 3 | @end 4 | @implementation PodsDummy_EurekaCreditCard 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase.modulemap: -------------------------------------------------------------------------------- 1 | framework module FBSnapshotTestCase { 2 | umbrella header "FBSnapshotTestCase-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_FBSnapshotTestCase : NSObject 3 | @end 4 | @implementation PodsDummy_FBSnapshotTestCase 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/EurekaCreditCard/EurekaCreditCard-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double EurekaCreditCardVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char EurekaCreditCardVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Example/EurekaCreditCard.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-BasePods-EurekaCreditCard_Tests/Pods-BasePods-EurekaCreditCard_Tests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_BasePods_EurekaCreditCard_Tests { 2 | umbrella header "Pods-BasePods-EurekaCreditCard_Tests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-BasePods-EurekaCreditCard_Example/Pods-BasePods-EurekaCreditCard_Example.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_BasePods_EurekaCreditCard_Example { 2 | umbrella header "Pods-BasePods-EurekaCreditCard_Example-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-BasePods-EurekaCreditCard_Tests/Pods-BasePods-EurekaCreditCard_Tests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_BasePods_EurekaCreditCard_Tests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_BasePods_EurekaCreditCard_Tests 5 | @end 6 | -------------------------------------------------------------------------------- /Example/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-BasePods-EurekaCreditCard_Example/Pods-BasePods-EurekaCreditCard_Example-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_BasePods_EurekaCreditCard_Example : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_BasePods_EurekaCreditCard_Example 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-BasePods-EurekaCreditCard_Tests/Pods-BasePods-EurekaCreditCard_Tests-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double Pods_BasePods_EurekaCreditCard_TestsVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char Pods_BasePods_EurekaCreditCard_TestsVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Example/EurekaCreditCard.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-BasePods-EurekaCreditCard_Example/Pods-BasePods-EurekaCreditCard_Example-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double Pods_BasePods_EurekaCreditCard_ExampleVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char Pods_BasePods_EurekaCreditCard_ExampleVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "FBSnapshotTestCase.h" 4 | #import "FBSnapshotTestCasePlatform.h" 5 | #import "FBSnapshotTestController.h" 6 | 7 | FOUNDATION_EXPORT double FBSnapshotTestCaseVersionNumber; 8 | FOUNDATION_EXPORT const unsigned char FBSnapshotTestCaseVersionString[]; 9 | 10 | -------------------------------------------------------------------------------- /Example/Pods/BKMoneyKit/BKMoneyKit/BKForwardingTextField.h: -------------------------------------------------------------------------------- 1 | // 2 | // BKForwardingTextField.h 3 | // BKMoneyKit 4 | // 5 | // Created by Byungkook Jang on 2014. 8. 24.. 6 | // Copyright (c) 2014년 Byungkook Jang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BKForwardingTextField : UITextField 12 | 13 | @property (nonatomic, assign, readonly) id userDelegate; 14 | 15 | - (void)commonInit; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Example/Pods/BKMoneyKit/BKMoneyKit/BKMoneyUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // BKMoneyUtils.h 3 | // BKMoneyKit 4 | // 5 | // Created by Byungkook Jang on 2014. 8. 24.. 6 | // Copyright (c) 2014년 Byungkook Jang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BKMoneyUtils : NSObject 12 | 13 | + (NSRegularExpression *)nonNumericRegularExpression; 14 | 15 | + (NSCharacterSet *)numberCharacterSet; 16 | 17 | + (UIImage *)cardLogoImageWithShortName:(NSString *)shortName; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/BKMoneyKit/BKMoneyKit-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "BKCardExpiryField.h" 4 | #import "BKCardNumberField.h" 5 | #import "BKCardNumberFormatter.h" 6 | #import "BKCardNumberLabel.h" 7 | #import "BKCardPatternInfo.h" 8 | #import "BKCurrencyTextField.h" 9 | #import "BKForwardingTextField.h" 10 | #import "BKMoneyUtils.h" 11 | 12 | FOUNDATION_EXPORT double BKMoneyKitVersionNumber; 13 | FOUNDATION_EXPORT const unsigned char BKMoneyKitVersionString[]; 14 | 15 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/BKMoneyKit/BKMoneyKit.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/BKMoneyKit 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | PODS_BUILD_DIR = $BUILD_DIR 5 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 8 | SKIP_INSTALL = YES 9 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * http://www.objc.io/issue-6/travis-ci.html 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | language: objective-c 6 | # cache: cocoapods 7 | # podfile: Example/Podfile 8 | # before_install: 9 | # - gem install cocoapods # Since Travis is not always on latest version 10 | # - pod install --project-directory=Example 11 | script: 12 | - set -o pipefail && xcodebuild test -workspace Example/EurekaCreditCard.xcworkspace -scheme EurekaCreditCard-Example -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty 13 | - pod lib lint 14 | -------------------------------------------------------------------------------- /Example/Pods/BKMoneyKit/BKMoneyKit/BKCardExpiryField.h: -------------------------------------------------------------------------------- 1 | // 2 | // BKCardExpiryField.h 3 | // BKMoneyKit 4 | // 5 | // Created by Byungkook Jang on 2014. 7. 6.. 6 | // Copyright (c) 2014년 Byungkook Jang. All rights reserved. 7 | // 8 | 9 | #import "BKForwardingTextField.h" 10 | 11 | @interface BKCardExpiryField : BKForwardingTextField 12 | 13 | /** 14 | * Date components that user typed. Undetermined components would be zero. 15 | */ 16 | @property (nonatomic, strong) NSDateComponents *dateComponents; 17 | 18 | + (NSInteger)currentYear; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Eureka/Eureka.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Eureka 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_LDFLAGS = -framework "Foundation" -framework "UIKit" 5 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT} 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Example/.idea/runConfigurations/EurekaCreditCard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIApplication+StrictKeyWindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #import 12 | 13 | @interface UIApplication (StrictKeyWindow) 14 | 15 | /** 16 | @return The receiver's @c keyWindow. Raises an assertion if @c nil. 17 | */ 18 | - (UIWindow *)fb_strictKeyWindow; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/EurekaCreditCard/EurekaCreditCard.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/EurekaCreditCard 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/BKMoneyKit" "$PODS_CONFIGURATION_BUILD_DIR/Eureka" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 5 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT} 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Example/Pods/BKMoneyKit/BKMoneyKit/BKCurrencyTextField.h: -------------------------------------------------------------------------------- 1 | // 2 | // BKCurrencyTextField.h 3 | // BKMoneyKit 4 | // 5 | // Created by Byungkook Jang on 2013. 11. 7.. 6 | // Copyright (c) 2013년 Byungkook Jang. All rights reserved. 7 | // 8 | 9 | #import "BKForwardingTextField.h" 10 | 11 | @interface BKCurrencyTextField : BKForwardingTextField 12 | 13 | /** 14 | * The currency style number formatter. 15 | * You can change currency by changing currencyCode or locale property of this formatter. 16 | */ 17 | @property (strong, nonatomic, readonly) NSNumberFormatter *numberFormatter; 18 | 19 | /** 20 | * The decimal number that user typed. 21 | */ 22 | @property (strong, nonatomic) NSDecimalNumber *numberValue; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Example/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | use_frameworks! 3 | 4 | pod 'Eureka', :git => 'https://github.com/xmartlabs/Eureka.git', :branch => 'swift2.3' 5 | pod 'BKMoneyKit', '0.0.8' 6 | 7 | abstract_target 'BasePods' do 8 | target 'EurekaCreditCard_Example' do 9 | pod 'EurekaCreditCard', :path => '../' 10 | end 11 | 12 | target 'EurekaCreditCard_Tests' do 13 | pod 'EurekaCreditCard', :path => '../' 14 | 15 | pod 'FBSnapshotTestCase' 16 | end 17 | end 18 | 19 | post_install do |installer| 20 | installer.pods_project.targets.each do |target| 21 | target.build_configurations.each do |config| 22 | config.build_settings['SWIFT_VERSION'] = '2.3' 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | Carthage 26 | # We recommend against adding the Pods directory to your .gitignore. However 27 | # you should judge for yourself, the pros and cons are mentioned at: 28 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 29 | # 30 | # Note: if you ignore the Pods directory, make sure to uncomment 31 | # `pod install` in .travis.yml 32 | # 33 | # Pods/ 34 | -------------------------------------------------------------------------------- /Example/.idea/runConfigurations/EurekaCreditCard_Example.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/Common/OptionsRow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OptionsRow.swift 3 | // Eureka 4 | // 5 | // Created by Martin Barreto on 2/23/16. 6 | // Copyright © 2016 Xmartlabs. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class OptionsRow : Row, NoValueDisplayTextConformance { 12 | 13 | public var options: [T] { 14 | get { return dataProvider?.arrayData ?? [] } 15 | set { dataProvider = DataProvider(arrayData: newValue) } 16 | } 17 | public var selectorTitle: String? 18 | public var noValueDisplayText: String? 19 | 20 | required public init(tag: String?) { 21 | super.init(tag: tag) 22 | } 23 | } -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/Eureka.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Eureka", 3 | "version": "1.7.0", 4 | "license": "MIT", 5 | "summary": "Elegant iOS Forms in pure Swift 2", 6 | "homepage": "https://github.com/xmartlabs/Eureka", 7 | "social_media_url": "http://twitter.com/xmartlabs", 8 | "authors": { 9 | "Martin Barreto": "martin@xmartlabs.com", 10 | "Mathias Claassen": "mathias@xmartlabs.com" 11 | }, 12 | "source": { 13 | "git": "https://github.com/xmartlabs/Eureka.git", 14 | "tag": "1.7.0" 15 | }, 16 | "platforms": { 17 | "ios": "8.0" 18 | }, 19 | "ios": { 20 | "frameworks": [ 21 | "UIKit", 22 | "Foundation" 23 | ] 24 | }, 25 | "source_files": "Source/**/*.swift", 26 | "resources": "Source/Resources/Eureka.bundle", 27 | "requires_arc": true 28 | } 29 | -------------------------------------------------------------------------------- /Example/EurekaCreditCard/Images.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 | } 39 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/FBSnapshotTestCase/FBSnapshotTestCase.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/FBSnapshotTestCase 2 | ENABLE_BITCODE = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 6 | OTHER_LDFLAGS = -framework "Foundation" -framework "QuartzCore" -framework "UIKit" -framework "XCTest" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = $BUILD_DIR 9 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_ROOT = ${SRCROOT} 11 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 12 | SKIP_INSTALL = YES 13 | -------------------------------------------------------------------------------- /Example/Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/MultipleSelectorRow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MultipleSelectorRow.swift 3 | // Eureka 4 | // 5 | // Created by Martin Barreto on 2/24/16. 6 | // Copyright © 2016 Xmartlabs. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class _MultipleSelectorRow>: GenericMultipleSelectorRow> { 12 | public required init(tag: String?) { 13 | super.init(tag: tag) 14 | } 15 | } 16 | 17 | /// A selector row where the user can pick several options from a pushed view controller 18 | public final class MultipleSelectorRow : _MultipleSelectorRow>>, RowType { 19 | public required init(tag: String?) { 20 | super.init(tag: tag) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/BKMoneyKit/ResourceBundle-BKMoneyKit-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleIdentifier 8 | ${PRODUCT_BUNDLE_IDENTIFIER} 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundleName 12 | ${PRODUCT_NAME} 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 0.0.8 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/Tests/Tests.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import XCTest 3 | import EurekaCreditCard 4 | 5 | class Tests: XCTestCase { 6 | 7 | override func setUp() { 8 | super.setUp() 9 | // Put setup code here. This method is called before the invocation of each test method in the class. 10 | } 11 | 12 | override func tearDown() { 13 | // Put teardown code here. This method is called after the invocation of each test method in the class. 14 | super.tearDown() 15 | } 16 | 17 | func testExample() { 18 | // This is an example of a functional test case. 19 | XCTAssert(true, "Pass") 20 | } 21 | 22 | func testPerformanceExample() { 23 | // This is an example of a performance test case. 24 | self.measureBlock() { 25 | // Put the code you want to measure the time of here. 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Snapshot.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #import 12 | 13 | @interface UIImage (Snapshot) 14 | 15 | /// Uses renderInContext: to get a snapshot of the layer. 16 | + (UIImage *)fb_imageForLayer:(CALayer *)layer; 17 | 18 | /// Uses renderInContext: to get a snapshot of the view layer. 19 | + (UIImage *)fb_imageForViewLayer:(UIView *)view; 20 | 21 | /// Uses drawViewHierarchyInRect: to get a snapshot of the view and adds the view into a window if needed. 22 | + (UIImage *)fb_imageForView:(UIView *)view; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/EurekaCreditCard/ResourceBundle-EurekaCreditCard-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleIdentifier 8 | ${PRODUCT_BUNDLE_IDENTIFIER} 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundleName 12 | ${PRODUCT_NAME} 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 0.1.4 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Eureka/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.7.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/BKMoneyKit/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.0.8 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/EurekaCreditCard/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.1.4 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/FBSnapshotTestCase/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 | 2.1.3 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/PushRow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PushRow.swift 3 | // Eureka 4 | // 5 | // Created by Martin Barreto on 2/24/16. 6 | // Copyright © 2016 Xmartlabs. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class _PushRow : SelectorRow> { 12 | 13 | public required init(tag: String?) { 14 | super.init(tag: tag) 15 | presentationMode = .Show(controllerProvider: ControllerProvider.Callback { return SelectorViewController(){ _ in } }, completionCallback: { vc in vc.navigationController?.popViewControllerAnimated(true) }) 16 | } 17 | } 18 | 19 | /// A selector row where the user can pick an option from a pushed view controller 20 | public final class PushRow : _PushRow>, RowType { 21 | public required init(tag: String?) { 22 | super.init(tag: tag) 23 | } 24 | } -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-BasePods-EurekaCreditCard_Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-BasePods-EurekaCreditCard_Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/LabelRow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LabelRow.swift 3 | // Eureka 4 | // 5 | // Created by Martin Barreto on 2/23/16. 6 | // Copyright © 2016 Xmartlabs. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | // MARK: LabelCell 12 | 13 | public class LabelCellOf: Cell, CellType { 14 | 15 | required public init(style: UITableViewCellStyle, reuseIdentifier: String?) { 16 | super.init(style: style, reuseIdentifier: reuseIdentifier) 17 | } 18 | 19 | public override func setup() { 20 | super.setup() 21 | selectionStyle = .None 22 | } 23 | } 24 | 25 | public typealias LabelCell = LabelCellOf 26 | 27 | // MARK: LabelRow 28 | 29 | public class _LabelRow: Row { 30 | required public init(tag: String?) { 31 | super.init(tag: tag) 32 | } 33 | } 34 | 35 | /// Simple row that can show title and value but is not editable by user. 36 | public final class LabelRow: _LabelRow, RowType { 37 | required public init(tag: String?) { 38 | super.init(tag: tag) 39 | } 40 | } -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-BasePods-EurekaCreditCard_Example/Pods-BasePods-EurekaCreditCard_Example.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/BKMoneyKit" "$PODS_CONFIGURATION_BUILD_DIR/Eureka" "$PODS_CONFIGURATION_BUILD_DIR/EurekaCreditCard" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/BKMoneyKit/BKMoneyKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Eureka/Eureka.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/EurekaCreditCard/EurekaCreditCard.framework/Headers" 7 | OTHER_LDFLAGS = $(inherited) -framework "BKMoneyKit" -framework "Eureka" -framework "EurekaCreditCard" 8 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 9 | PODS_BUILD_DIR = $BUILD_DIR 10 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-BasePods-EurekaCreditCard_Example/Pods-BasePods-EurekaCreditCard_Example.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/BKMoneyKit" "$PODS_CONFIGURATION_BUILD_DIR/Eureka" "$PODS_CONFIGURATION_BUILD_DIR/EurekaCreditCard" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/BKMoneyKit/BKMoneyKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Eureka/Eureka.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/EurekaCreditCard/EurekaCreditCard.framework/Headers" 7 | OTHER_LDFLAGS = $(inherited) -framework "BKMoneyKit" -framework "Eureka" -framework "EurekaCreditCard" 8 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 9 | PODS_BUILD_DIR = $BUILD_DIR 10 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to this project will be documented in this file. 3 | 4 | ### [0.1.4](https://github.com/demetrio812/EurekaCreditCard/releases/tag/0.1.4) 5 | * Update Eureka to the latest 2.3 branch version 6 | * Examples now run on XCode 8 7 | * Small fixes 8 | 9 | Please note that this version needs the Swift 2.3 branch of Eureka. For this reason I cannot publish the new release in Cocoapods as branches are not allowed as dependencies in the podspec (http://guides.cocoapods.org/syntax/podspec.html#dependency). 10 | 11 | ### [0.1.3](https://github.com/demetrio812/EurekaCreditCard/releases/tag/0.1.3) 12 | * CVC numbers are hidden now 13 | 14 | ### [0.1.2](https://github.com/demetrio812/EurekaCreditCard/releases/tag/0.1.2) 15 | * Example fixed 16 | * Crash when selecting the first row of the picker fixed 17 | 18 | ### [0.1.1](https://github.com/demetrio812/EurekaCreditCard/releases/tag/0.1.1) 19 | Podspec fixed. 20 | 21 | ### [0.1.0](https://github.com/demetrio812/EurekaCreditCard/releases/tag/0.1.0) 22 | Released on 2016-04-02. This is the initial version. 23 | 24 | 25 | [demetrio812]: https://github.com/demetrio812 -------------------------------------------------------------------------------- /Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIApplication+StrictKeyWindow.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #import 12 | 13 | @implementation UIApplication (StrictKeyWindow) 14 | 15 | - (UIWindow *)fb_strictKeyWindow 16 | { 17 | UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow; 18 | if (!keyWindow) { 19 | [NSException raise:@"FBSnapshotTestCaseNilKeyWindowException" 20 | format:@"Snapshot tests must be hosted by an application with a key window. Please ensure your test" 21 | " host sets up a key window at launch (either via storyboards or programmatically) and doesn't" 22 | " do anything to remove it while snapshot tests are running."]; 23 | } 24 | return keyWindow; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Demetrio Filocamo 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 | -------------------------------------------------------------------------------- /Example/Pods/BKMoneyKit/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Byungkook Jang 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 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 XMARTLABS 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 | 23 | -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/EurekaCreditCard.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "EurekaCreditCard", 3 | "version": "0.1.4", 4 | "summary": "Eureka custom row and cell for credit card data", 5 | "description": "Custom Credit Card row for Eureka to quickly collect credit card data in an Eureka form.", 6 | "homepage": "https://github.com/demetrio812/EurekaCreditCard", 7 | "screenshots": [ 8 | "https://github.com/demetrio812/EurekaCreditCard/raw/master/demo_styles.png", 9 | "https://github.com/demetrio812/EurekaCreditCard/raw/master/demo_selector.png" 10 | ], 11 | "license": "MIT", 12 | "authors": { 13 | "Demetrio Filocamo": "filocamo@demetrio.it" 14 | }, 15 | "source": { 16 | "git": "https://github.com/demetrio812/EurekaCreditCard.git", 17 | "tag": "0.1.4" 18 | }, 19 | "social_media_url": "https://twitter.com/demetrio812", 20 | "platforms": { 21 | "ios": "8.0" 22 | }, 23 | "requires_arc": true, 24 | "source_files": "Pod/Classes/**/*", 25 | "resource_bundles": { 26 | "EurekaCreditCard": [ 27 | "Pod/Assets/*.png" 28 | ] 29 | }, 30 | "dependencies": { 31 | "Eureka": [ 32 | 33 | ], 34 | "BKMoneyKit": [ 35 | 36 | ] 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Example/Pods/BKMoneyKit/BKMoneyKit/BKCardNumberLabel.h: -------------------------------------------------------------------------------- 1 | // 2 | // BKCardNumberLabel.h 3 | // BKMoneyKitDemo 4 | // 5 | // Created by Byungkook Jang on 2014. 9. 21.. 6 | // Copyright (c) 2014년 Byungkook Jang. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BKCardNumberFormatter.h" 11 | 12 | @interface BKCardNumberLabel : UILabel 13 | 14 | /** 15 | * A Boolean indicating whether shows card logo left side or not. 16 | */ 17 | @property (nonatomic) BOOL showsCardLogo; 18 | 19 | /** 20 | * The card number without blank space. (e.g., 1234123412341234) 21 | * Use this property to set or get card number instead of text property. 22 | */ 23 | @property (nonatomic, strong) NSString *cardNumber; 24 | 25 | /** 26 | * The card company name. (e.g., Visa, Master, ...) 27 | */ 28 | @property (nonatomic, readonly) NSString *cardCompanyName; 29 | 30 | /** 31 | * The card number formatter. You can change formatting behavior using this property. 32 | */ 33 | @property (nonatomic, strong, readonly) BKCardNumberFormatter *cardNumberFormatter; 34 | 35 | /** 36 | * The card number logo image view. 37 | */ 38 | @property (nonatomic, strong, readonly) UIImageView *cardLogoImageView; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Example/Pods/BKMoneyKit/BKMoneyKit/BKCardNumberField.h: -------------------------------------------------------------------------------- 1 | // 2 | // BKCardNumberField.h 3 | // BKMoneyKit 4 | // 5 | // Created by Byungkook Jang on 2014. 8. 23.. 6 | // Copyright (c) 2014년 Byungkook Jang. All rights reserved. 7 | // 8 | 9 | #import "BKForwardingTextField.h" 10 | #import "BKCardNumberFormatter.h" 11 | 12 | @interface BKCardNumberField : BKForwardingTextField 13 | 14 | /** 15 | * A Boolean indicating whether shows card logo left side or not. 16 | */ 17 | @property (nonatomic) BOOL showsCardLogo; 18 | 19 | /** 20 | * The card number without blank space. (e.g., 1234123412341234) 21 | * Use this property to set or get card number instead of text property. 22 | */ 23 | @property (nonatomic, strong) NSString *cardNumber; 24 | 25 | /** 26 | * The card company name. (e.g., Visa, Master, ...) 27 | */ 28 | @property (nonatomic, readonly) NSString *cardCompanyName; 29 | 30 | /** 31 | * The card number formatter. You can change formatting behavior using this property. 32 | */ 33 | @property (nonatomic, strong, readonly) BKCardNumberFormatter *cardNumberFormatter; 34 | 35 | /** 36 | * The card number logo image view. 37 | */ 38 | @property (nonatomic, strong, readonly) UIImageView *cardLogoImageView; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - BKMoneyKit (0.0.8) 3 | - Eureka (1.7.0) 4 | - EurekaCreditCard (0.1.4): 5 | - BKMoneyKit 6 | - Eureka 7 | - FBSnapshotTestCase (2.1.3): 8 | - FBSnapshotTestCase/SwiftSupport (= 2.1.3) 9 | - FBSnapshotTestCase/Core (2.1.3) 10 | - FBSnapshotTestCase/SwiftSupport (2.1.3): 11 | - FBSnapshotTestCase/Core 12 | 13 | DEPENDENCIES: 14 | - BKMoneyKit (= 0.0.8) 15 | - Eureka (from `https://github.com/xmartlabs/Eureka.git`, branch `swift2.3`) 16 | - EurekaCreditCard (from `../`) 17 | - FBSnapshotTestCase 18 | 19 | EXTERNAL SOURCES: 20 | Eureka: 21 | :branch: swift2.3 22 | :git: https://github.com/xmartlabs/Eureka.git 23 | EurekaCreditCard: 24 | :path: ../ 25 | 26 | CHECKOUT OPTIONS: 27 | Eureka: 28 | :commit: 29e73c3a2196732de0acac136e911143290390cf 29 | :git: https://github.com/xmartlabs/Eureka.git 30 | 31 | SPEC CHECKSUMS: 32 | BKMoneyKit: cbf7091f26242917a15b3fa337fdb4da3fe3675a 33 | Eureka: 2020d9faeef7b7e9adeb9e3d8af779e5931c1897 34 | EurekaCreditCard: 4a8b954663365768c675d726de5bd362a3f716f2 35 | FBSnapshotTestCase: 4607968e0dfa1e2772ec0d0098354f8b870c5753 36 | 37 | PODFILE CHECKSUM: 5ab6380740bed5a828e2bf0fabe34d6e4c20ed9e 38 | 39 | COCOAPODS: 1.1.0.rc.2 40 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - BKMoneyKit (0.0.8) 3 | - Eureka (1.7.0) 4 | - EurekaCreditCard (0.1.4): 5 | - BKMoneyKit 6 | - Eureka 7 | - FBSnapshotTestCase (2.1.3): 8 | - FBSnapshotTestCase/SwiftSupport (= 2.1.3) 9 | - FBSnapshotTestCase/Core (2.1.3) 10 | - FBSnapshotTestCase/SwiftSupport (2.1.3): 11 | - FBSnapshotTestCase/Core 12 | 13 | DEPENDENCIES: 14 | - BKMoneyKit (= 0.0.8) 15 | - Eureka (from `https://github.com/xmartlabs/Eureka.git`, branch `swift2.3`) 16 | - EurekaCreditCard (from `../`) 17 | - FBSnapshotTestCase 18 | 19 | EXTERNAL SOURCES: 20 | Eureka: 21 | :branch: swift2.3 22 | :git: https://github.com/xmartlabs/Eureka.git 23 | EurekaCreditCard: 24 | :path: ../ 25 | 26 | CHECKOUT OPTIONS: 27 | Eureka: 28 | :commit: 29e73c3a2196732de0acac136e911143290390cf 29 | :git: https://github.com/xmartlabs/Eureka.git 30 | 31 | SPEC CHECKSUMS: 32 | BKMoneyKit: cbf7091f26242917a15b3fa337fdb4da3fe3675a 33 | Eureka: 2020d9faeef7b7e9adeb9e3d8af779e5931c1897 34 | EurekaCreditCard: 4a8b954663365768c675d726de5bd362a3f716f2 35 | FBSnapshotTestCase: 4607968e0dfa1e2772ec0d0098354f8b870c5753 36 | 37 | PODFILE CHECKSUM: 5ab6380740bed5a828e2bf0fabe34d6e4c20ed9e 38 | 39 | COCOAPODS: 1.1.0.rc.2 40 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-BasePods-EurekaCreditCard_Tests/Pods-BasePods-EurekaCreditCard_Tests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) $(PLATFORM_DIR)/Developer/Library/Frameworks "$PODS_CONFIGURATION_BUILD_DIR/BKMoneyKit" "$PODS_CONFIGURATION_BUILD_DIR/Eureka" "$PODS_CONFIGURATION_BUILD_DIR/EurekaCreditCard" "$PODS_CONFIGURATION_BUILD_DIR/FBSnapshotTestCase" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/BKMoneyKit/BKMoneyKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Eureka/Eureka.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/EurekaCreditCard/EurekaCreditCard.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSnapshotTestCase/FBSnapshotTestCase.framework/Headers" 7 | OTHER_LDFLAGS = $(inherited) -framework "BKMoneyKit" -framework "Eureka" -framework "EurekaCreditCard" -framework "FBSnapshotTestCase" 8 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 9 | PODS_BUILD_DIR = $BUILD_DIR 10 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-BasePods-EurekaCreditCard_Tests/Pods-BasePods-EurekaCreditCard_Tests.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) $(PLATFORM_DIR)/Developer/Library/Frameworks "$PODS_CONFIGURATION_BUILD_DIR/BKMoneyKit" "$PODS_CONFIGURATION_BUILD_DIR/Eureka" "$PODS_CONFIGURATION_BUILD_DIR/EurekaCreditCard" "$PODS_CONFIGURATION_BUILD_DIR/FBSnapshotTestCase" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/BKMoneyKit/BKMoneyKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Eureka/Eureka.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/EurekaCreditCard/EurekaCreditCard.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/FBSnapshotTestCase/FBSnapshotTestCase.framework/Headers" 7 | OTHER_LDFLAGS = $(inherited) -framework "BKMoneyKit" -framework "Eureka" -framework "EurekaCreditCard" -framework "FBSnapshotTestCase" 8 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 9 | PODS_BUILD_DIR = $BUILD_DIR 10 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Example/EurekaCreditCard/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/Controllers/ImagePickerController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImagePickerController.swift 3 | // Eureka 4 | // 5 | // Created by Martin Barreto on 2/24/16. 6 | // Copyright © 2016 Xmartlabs. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// Selector Controller used to pick an image 12 | public class ImagePickerController : UIImagePickerController, TypedRowControllerType, UIImagePickerControllerDelegate, UINavigationControllerDelegate { 13 | 14 | /// The row that pushed or presented this controller 15 | public var row: RowOf! 16 | 17 | /// A closure to be called when the controller disappears. 18 | public var completionCallback : ((UIViewController) -> ())? 19 | 20 | public override func viewDidLoad() { 21 | super.viewDidLoad() 22 | delegate = self 23 | } 24 | 25 | public func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]){ 26 | (row as? ImageRow)?.imageURL = info[UIImagePickerControllerReferenceURL] as? NSURL 27 | row.value = info[UIImagePickerControllerOriginalImage] as? UIImage 28 | completionCallback?(self) 29 | } 30 | 31 | public func imagePickerControllerDidCancel(picker: UIImagePickerController){ 32 | completionCallback?(self) 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /Example/Pods/BKMoneyKit/BKMoneyKit/BKCardPatternInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // BKCardPatternInfo.h 3 | // BKMoneyKit 4 | // 5 | // Created by Byungkook Jang on 2014. 8. 23.. 6 | // Copyright (c) 2014년 Byungkook Jang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BKCardPatternInfo : NSObject 12 | 13 | /** 14 | * The card company name. (e.g., Visa, Master, ...) 15 | */ 16 | @property (nonatomic, strong, readonly) NSString *companyName; 17 | 18 | /** 19 | * Short card company name. (e.g., visa, master, ...) 20 | */ 21 | @property (nonatomic, strong, readonly) NSString *shortName; 22 | 23 | /** 24 | * 25 | */ 26 | @property (nonatomic, readonly) NSInteger numberOfGroups; 27 | 28 | /** 29 | * Initialize card pattern info with dictionary object in CardPatterns.plist 30 | */ 31 | - (instancetype)initWithDictionary:(NSDictionary *)aDictionary; 32 | 33 | /** 34 | * Check whether number string matches credit card number pattern. 35 | */ 36 | - (BOOL)patternMatchesWithNumberString:(NSString *)aNumberString; 37 | 38 | /** 39 | * Returns formatted card number string. (e.g., 1234 1234 1234 1234) 40 | */ 41 | - (NSString *)groupedStringWithString:(NSString *)aString 42 | groupSeparater:(NSString *)aGroupSeparater 43 | maskingCharacter:(NSString *)aMaskingCharacter 44 | maskingGroupIndexSet:(NSIndexSet *)aMaskingGroupIndexSet; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Example/Pods/BKMoneyKit/BKMoneyKit/BKMoneyUtils.m: -------------------------------------------------------------------------------- 1 | // 2 | // BKMoneyUtils.m 3 | // BKMoneyKit 4 | // 5 | // Created by Byungkook Jang on 2014. 8. 24.. 6 | // Copyright (c) 2014년 Byungkook Jang. All rights reserved. 7 | // 8 | 9 | #import "BKMoneyUtils.h" 10 | 11 | @implementation BKMoneyUtils 12 | 13 | + (NSRegularExpression *)nonNumericRegularExpression 14 | { 15 | return [NSRegularExpression regularExpressionWithPattern:@"[^0-9]+" options:0 error:nil]; 16 | } 17 | 18 | + (NSCharacterSet *)numberCharacterSet 19 | { 20 | return [NSCharacterSet characterSetWithCharactersInString:@"0123456789"]; 21 | } 22 | 23 | + (UIImage *)cardLogoImageWithShortName:(NSString *)shortName 24 | { 25 | UIImage *cardLogoImage = nil; 26 | 27 | if (shortName) { 28 | //Check if local image exist 29 | UIImage *localCardLogoImage = [UIImage imageNamed:shortName]; 30 | 31 | if (localCardLogoImage == nil) { 32 | cardLogoImage = [self imageNamed:[NSString stringWithFormat:@"BKMoneyKit.bundle/CardLogo/%@@2x", shortName]]; 33 | }else{ 34 | cardLogoImage = localCardLogoImage; 35 | } 36 | } 37 | 38 | if (nil == cardLogoImage) { 39 | cardLogoImage = [self imageNamed:@"BKMoneyKit.bundle/CardLogo/default@2x"]; 40 | } 41 | 42 | return cardLogoImage; 43 | } 44 | 45 | + (UIImage *)imageNamed:(NSString *)imageName { 46 | NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:imageName ofType:@"png"]; 47 | return [UIImage imageWithContentsOfFile:path]; 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/Common/DecimalFormatter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DecimalFormatter.swift 3 | // Eureka 4 | // 5 | // Created by Martin Barreto on 2/24/16. 6 | // Copyright © 2016 Xmartlabs. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class DecimalFormatter : NSNumberFormatter, FormatterProtocol { 12 | 13 | public override init() { 14 | super.init() 15 | locale = .currentLocale() 16 | numberStyle = .DecimalStyle 17 | minimumFractionDigits = 2 18 | maximumFractionDigits = 2 19 | } 20 | 21 | required public init?(coder aDecoder: NSCoder) { 22 | fatalError("init(coder:) has not been implemented") 23 | } 24 | 25 | override public func getObjectValue(obj: AutoreleasingUnsafeMutablePointer, forString string: String, errorDescription error: AutoreleasingUnsafeMutablePointer) -> Bool { 26 | guard obj != nil else { return false } 27 | let str = string.componentsSeparatedByCharactersInSet(NSCharacterSet.decimalDigitCharacterSet().invertedSet).joinWithSeparator("") 28 | obj.memory = NSNumber(double: (Double(str) ?? 0.0)/Double(pow(10.0, Double(minimumFractionDigits)))) 29 | return true 30 | } 31 | 32 | public func getNewPosition(forPosition: UITextPosition, inTextInput textInput: UITextInput, oldValue: String?, newValue: String?) -> UITextPosition { 33 | return textInput.positionFromPosition(forPosition, offset:((newValue?.characters.count ?? 0) - (oldValue?.characters.count ?? 0))) ?? forPosition 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /EurekaCreditCard.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint EurekaCreditCard.podspec' to ensure this is a 3 | # valid spec before submitting. 4 | # 5 | # Any lines starting with a # are optional, but their use is encouraged 6 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = "EurekaCreditCard" 11 | s.version = "0.1.4" 12 | s.summary = "Eureka custom row and cell for credit card data" 13 | 14 | s.description = <<-DESC 15 | Custom Credit Card row for Eureka to quickly collect credit card data in an Eureka form. 16 | DESC 17 | 18 | s.homepage = "https://github.com/demetrio812/EurekaCreditCard" 19 | s.screenshots = "https://github.com/demetrio812/EurekaCreditCard/raw/master/demo_styles.png", "https://github.com/demetrio812/EurekaCreditCard/raw/master/demo_selector.png" 20 | s.license = 'MIT' 21 | s.author = { "Demetrio Filocamo" => "filocamo@demetrio.it" } 22 | s.source = { :git => "https://github.com/demetrio812/EurekaCreditCard.git", :tag => s.version.to_s } 23 | s.social_media_url = 'https://twitter.com/demetrio812' 24 | 25 | s.platform = :ios, '8.0' 26 | s.requires_arc = true 27 | 28 | s.source_files = 'Pod/Classes/**/*' 29 | s.resource_bundles = { 30 | 'EurekaCreditCard' => ['Pod/Assets/*.png'] 31 | } 32 | 33 | # s.public_header_files = 'Pod/Classes/**/*.h' 34 | # s.frameworks = 'UIKit', 'MapKit' 35 | s.dependency 'Eureka' 36 | s.dependency 'BKMoneyKit' 37 | end 38 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Core/SelectableRowType.swift: -------------------------------------------------------------------------------- 1 | // SelectableRowType.swift 2 | // Eureka ( https://github.com/xmartlabs/Eureka ) 3 | // 4 | // Copyright (c) 2016 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 Foundation 27 | 28 | /** 29 | * Every row that shall be used in a SelectableSection must conform to this protocol. 30 | */ 31 | public protocol SelectableRowType : TypedRowType, RowType { 32 | var selectableValue : Value? { get set } 33 | } -------------------------------------------------------------------------------- /Example/Pods/BKMoneyKit/BKMoneyKit/BKCardNumberFormatter.h: -------------------------------------------------------------------------------- 1 | // 2 | // BKCardNumberFormatter.h 3 | // BKMoneyKit 4 | // 5 | // Created by Byungkook Jang on 2014. 8. 23.. 6 | // Copyright (c) 2014년 Byungkook Jang. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BKCardPatternInfo.h" 11 | 12 | 13 | @interface BKCardNumberFormatter : NSFormatter 14 | 15 | /** 16 | * The card pattern info that is used last time. 17 | */ 18 | @property (nonatomic, strong, readonly) BKCardPatternInfo *cardPatternInfo; 19 | 20 | /** 21 | * The masking character. If this property is nil, entire card number will be shown. 22 | */ 23 | @property (nonatomic, strong) NSString *maskingCharacter; 24 | 25 | /** 26 | * Card number group indexes to mask. 27 | * For example you can mask second, third and fourth group by setting [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(1, 3)] to this property. 28 | * As a result, '1234 1234 1234 1234' will be '1234 **** **** ****'. 29 | */ 30 | @property (nonatomic, strong) NSIndexSet *maskingGroupIndexSet; 31 | 32 | /** 33 | * Card number group separater. By default ' '(one space character) will be used. 34 | * For example, if you set '-', '1234-1234-1234-1234' will be returned. 35 | */ 36 | @property (nonatomic, strong) NSString *groupSeparater; 37 | 38 | /** 39 | * Returns formatted card number string from raw string. 40 | */ 41 | - (NSString *)formattedStringFromRawString:(NSString *)rawString; 42 | 43 | /** 44 | * Returns raw string from formatted string. 45 | */ 46 | - (NSString *)rawStringFromFormattedString:(NSString *)string; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Example/Pods/FBSnapshotTestCase/LICENSE: -------------------------------------------------------------------------------- 1 | BSD License 2 | 3 | For the FBSnapshotTestCase software 4 | 5 | Copyright (c) 2013, Facebook, Inc. 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | 11 | * Redistributions of source code must retain the above copyright notice, 12 | this list of conditions and the following disclaimer. 13 | * Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | * Neither the name Facebook nor the names of its contributors may be used to 17 | endorse or promote products derived from this software without specific 18 | prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Diff.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Gabriel Handford on 3/1/09. 3 | // Copyright 2009-2013. All rights reserved. 4 | // Created by John Boiles on 10/20/11. 5 | // Copyright (c) 2011. All rights reserved 6 | // Modified by Felix Schulze on 2/11/13. 7 | // Copyright 2013. All rights reserved. 8 | // 9 | // Permission is hereby granted, free of charge, to any person 10 | // obtaining a copy of this software and associated documentation 11 | // files (the "Software"), to deal in the Software without 12 | // restriction, including without limitation the rights to use, 13 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | // copies of the Software, and to permit persons to whom the 15 | // Software is furnished to do so, subject to the following 16 | // conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be 19 | // included in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 22 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 23 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 24 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 25 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 26 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 27 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 28 | // OTHER DEALINGS IN THE SOFTWARE. 29 | // 30 | 31 | #import 32 | 33 | @interface UIImage (Diff) 34 | 35 | - (UIImage *)fb_diffWithImage:(UIImage *)image; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Core/RowControllerType.swift: -------------------------------------------------------------------------------- 1 | // RowControllerType.swift 2 | // Eureka ( https://github.com/xmartlabs/Eureka ) 3 | // 4 | // Copyright (c) 2016 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 Foundation 27 | 28 | 29 | /** 30 | * Base protocol for view controllers presented by Eureka rows. 31 | */ 32 | public protocol RowControllerType : NSObjectProtocol { 33 | 34 | /// A closure to be called when the controller disappears. 35 | var completionCallback : ((UIViewController) -> ())? { get set } 36 | } -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/PopoverSelectorRow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PopoverSelectorRow.swift 3 | // Eureka 4 | // 5 | // Created by Martin Barreto on 2/24/16. 6 | // Copyright © 2016 Xmartlabs. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class _PopoverSelectorRow : SelectorRow> { 12 | 13 | public required init(tag: String?) { 14 | super.init(tag: tag) 15 | onPresentCallback = { [weak self] (_, viewController) -> Void in 16 | guard let porpoverController = viewController.popoverPresentationController, tableView = self?.baseCell.formViewController()?.tableView, cell = self?.cell else { 17 | fatalError() 18 | } 19 | porpoverController.sourceView = tableView 20 | porpoverController.sourceRect = tableView.convertRect(cell.detailTextLabel?.frame ?? cell.textLabel?.frame ?? cell.contentView.frame, fromView: cell) 21 | } 22 | presentationMode = .Popover(controllerProvider: ControllerProvider.Callback { return SelectorViewController(){ _ in } }, completionCallback: { [weak self] in 23 | $0.dismissViewControllerAnimated(true, completion: nil) 24 | self?.reload() 25 | }) 26 | } 27 | 28 | public override func didSelect() { 29 | deselect() 30 | super.didSelect() 31 | } 32 | } 33 | 34 | public final class PopoverSelectorRow : _PopoverSelectorRow>, RowType { 35 | public required init(tag: String?) { 36 | super.init(tag: tag) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Example/EurekaCreditCard/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Compare.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Gabriel Handford on 3/1/09. 3 | // Copyright 2009-2013. All rights reserved. 4 | // Created by John Boiles on 10/20/11. 5 | // Copyright (c) 2011. All rights reserved 6 | // Modified by Felix Schulze on 2/11/13. 7 | // Copyright 2013. All rights reserved. 8 | // 9 | // Permission is hereby granted, free of charge, to any person 10 | // obtaining a copy of this software and associated documentation 11 | // files (the "Software"), to deal in the Software without 12 | // restriction, including without limitation the rights to use, 13 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | // copies of the Software, and to permit persons to whom the 15 | // Software is furnished to do so, subject to the following 16 | // conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be 19 | // included in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 22 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 23 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 24 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 25 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 26 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 27 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 28 | // OTHER DEALINGS IN THE SOFTWARE. 29 | // 30 | 31 | #import 32 | 33 | @interface UIImage (Compare) 34 | 35 | - (BOOL)fb_compareWithImage:(UIImage *)image tolerance:(CGFloat)tolerance; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/Common/Protocols.swift: -------------------------------------------------------------------------------- 1 | // Protocols.swift 2 | // Eureka ( https://github.com/xmartlabs/Eureka ) 3 | // 4 | // Copyright (c) 2016 Xmartlabs SRL ( 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 | import Foundation 26 | 27 | public protocol FormatterConformance: class { 28 | var formatter: NSFormatter? { get set } 29 | var useFormatterDuringInput: Bool { get set } 30 | var useFormatterOnDidBeginEditing: Bool? { get set } 31 | } 32 | 33 | public protocol NoValueDisplayTextConformance: class { 34 | var noValueDisplayText: String? { get set } 35 | } 36 | -------------------------------------------------------------------------------- /Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCasePlatform.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #import 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | /** 18 | Returns a Boolean value that indicates whether the snapshot test is running in 64Bit. 19 | This method is a convenience for creating the suffixes set based on the architecture 20 | that the test is running. 21 | 22 | @returns @c YES if the test is running in 64bit, otherwise @c NO. 23 | */ 24 | BOOL FBSnapshotTestCaseIs64Bit(void); 25 | 26 | /** 27 | Returns a default set of strings that is used to append a suffix based on the architectures. 28 | @warning Do not modify this function, you can create your own and use it with @c FBSnapshotVerifyViewWithOptions() 29 | 30 | @returns An @c NSOrderedSet object containing strings that are appended to the reference images directory. 31 | */ 32 | NSOrderedSet *FBSnapshotTestCaseDefaultSuffixes(void); 33 | 34 | /** 35 | Returns a fully «normalized» file name. 36 | Strips punctuation and spaces and replaces them with @c _. Also appends the device model, running OS and screen size to the file name. 37 | 38 | @returns An @c NSString object containing the passed @c fileName with the device model, OS and screen size appended at the end. 39 | */ 40 | NSString *FBDeviceAgnosticNormalizedFileName(NSString *fileName); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/Controllers/SelectorAlertController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SelectorAlertController.swift 3 | // Eureka 4 | // 5 | // Created by Martin Barreto on 2/24/16. 6 | // Copyright © 2016 Xmartlabs. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// Selector UIAlertController 12 | public class SelectorAlertController : UIAlertController, TypedRowControllerType { 13 | 14 | /// The row that pushed or presented this controller 15 | public var row: RowOf! 16 | 17 | public var cancelTitle = NSLocalizedString("Cancel", comment: "") 18 | 19 | /// A closure to be called when the controller disappears. 20 | public var completionCallback : ((UIViewController) -> ())? 21 | 22 | override public init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) { 23 | super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) 24 | } 25 | 26 | required public init?(coder aDecoder: NSCoder) { 27 | super.init(coder: aDecoder) 28 | } 29 | 30 | convenience public init(_ callback: (UIViewController) -> ()){ 31 | self.init() 32 | completionCallback = callback 33 | } 34 | 35 | public override func viewDidLoad() { 36 | super.viewDidLoad() 37 | guard let options = row.dataProvider?.arrayData else { return } 38 | addAction(UIAlertAction(title: cancelTitle, style: .Cancel, handler: nil)) 39 | for option in options { 40 | addAction(UIAlertAction(title: row.displayValueFor?(option), style: .Default, handler: { [weak self] _ in 41 | self?.row.value = option 42 | self?.completionCallback?(self!) 43 | })) 44 | } 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/SelectableRows/ListCheckRow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ListCheckRow.swift 3 | // Eureka 4 | // 5 | // Created by Martin Barreto on 2/24/16. 6 | // Copyright © 2016 Xmartlabs. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class ListCheckCell : Cell, CellType { 12 | 13 | required public init(style: UITableViewCellStyle, reuseIdentifier: String?) { 14 | super.init(style: style, reuseIdentifier: reuseIdentifier) 15 | } 16 | 17 | public override func update() { 18 | super.update() 19 | accessoryType = row.value != nil ? .Checkmark : .None 20 | editingAccessoryType = accessoryType 21 | selectionStyle = .Default 22 | var red: CGFloat = 0, green: CGFloat = 0, blue: CGFloat = 0, alpha: CGFloat = 0 23 | tintColor.getRed(&red, green: &green, blue: &blue, alpha: &alpha) 24 | if row.isDisabled { 25 | tintColor = UIColor(red: red, green: green, blue: blue, alpha: 0.3) 26 | selectionStyle = .None 27 | } 28 | else { 29 | tintColor = UIColor(red: red, green: green, blue: blue, alpha: 1) 30 | } 31 | } 32 | 33 | public override func setup() { 34 | super.setup() 35 | accessoryType = .Checkmark 36 | editingAccessoryType = accessoryType 37 | } 38 | 39 | public override func didSelect() { 40 | row.deselect() 41 | row.updateCell() 42 | } 43 | 44 | } 45 | 46 | 47 | public final class ListCheckRow: Row>, SelectableRowType, RowType { 48 | public var selectableValue: T? 49 | required public init(tag: String?) { 50 | super.init(tag: tag) 51 | displayValueFor = nil 52 | } 53 | } -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/SwitchRow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwitchRow.swift 3 | // Eureka 4 | // 5 | // Created by Martin Barreto on 2/23/16. 6 | // Copyright © 2016 Xmartlabs. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | // MARK: SwitchCell 12 | 13 | public class SwitchCell : Cell, CellType { 14 | 15 | public typealias Value = Bool 16 | 17 | required public init(style: UITableViewCellStyle, reuseIdentifier: String?) { 18 | super.init(style: style, reuseIdentifier: reuseIdentifier) 19 | } 20 | 21 | public var switchControl: UISwitch? { 22 | return accessoryView as? UISwitch 23 | } 24 | 25 | public override func setup() { 26 | super.setup() 27 | selectionStyle = .None 28 | accessoryView = UISwitch() 29 | editingAccessoryView = accessoryView 30 | switchControl?.addTarget(self, action: #selector(SwitchCell.valueChanged), forControlEvents: .ValueChanged) 31 | } 32 | 33 | deinit { 34 | switchControl?.removeTarget(self, action: nil, forControlEvents: .AllEvents) 35 | } 36 | 37 | public override func update() { 38 | super.update() 39 | switchControl?.on = row.value ?? false 40 | switchControl?.enabled = !row.isDisabled 41 | } 42 | 43 | func valueChanged() { 44 | row.value = switchControl?.on.boolValue ?? false 45 | } 46 | } 47 | 48 | // MARK: SwitchRow 49 | 50 | public class _SwitchRow: Row { 51 | required public init(tag: String?) { 52 | super.init(tag: tag) 53 | displayValueFor = nil 54 | } 55 | } 56 | 57 | 58 | /// Boolean row that has a UISwitch as accessoryType 59 | public final class SwitchRow: _SwitchRow, RowType { 60 | required public init(tag: String?) { 61 | super.init(tag: tag) 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Example/Pods/BKMoneyKit/BKMoneyKit/BKForwardingTextField.m: -------------------------------------------------------------------------------- 1 | // 2 | // BKForwardingTextField.m 3 | // BKMoneyKit 4 | // 5 | // Created by Byungkook Jang on 2014. 8. 24.. 6 | // Copyright (c) 2014년 Byungkook Jang. All rights reserved. 7 | // 8 | 9 | #import "BKForwardingTextField.h" 10 | 11 | @interface BKForwardingTextField () 12 | 13 | @end 14 | 15 | @implementation BKForwardingTextField 16 | 17 | - (instancetype)initWithFrame:(CGRect)frame 18 | { 19 | self = [super initWithFrame:frame]; 20 | if (self) { 21 | [self commonInit]; 22 | } 23 | return self; 24 | } 25 | 26 | - (instancetype)initWithCoder:(NSCoder *)coder 27 | { 28 | self = [super initWithCoder:coder]; 29 | if (self) { 30 | [self commonInit]; 31 | } 32 | return self; 33 | } 34 | 35 | - (void)commonInit 36 | { 37 | [super setDelegate:self]; 38 | } 39 | 40 | #pragma mark - Fowarding 41 | 42 | - (void)setDelegate:(id)delegate 43 | { 44 | if (_userDelegate != delegate) { 45 | _userDelegate = delegate; 46 | } 47 | } 48 | 49 | - (void)forwardInvocation:(NSInvocation *)anInvocation 50 | { 51 | if ([_userDelegate respondsToSelector:anInvocation.selector]) { 52 | [anInvocation invokeWithTarget:_userDelegate]; 53 | } else { 54 | [super forwardInvocation:anInvocation]; 55 | } 56 | } 57 | 58 | - (BOOL)respondsToSelector:(SEL)aSelector 59 | { 60 | if ([super respondsToSelector:aSelector]) { 61 | return YES; 62 | } else { 63 | return [_userDelegate respondsToSelector:aSelector]; 64 | } 65 | } 66 | 67 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector 68 | { 69 | NSMethodSignature *signature = [super methodSignatureForSelector:aSelector]; 70 | if (nil == signature) { 71 | signature = [(NSObject *)_userDelegate methodSignatureForSelector:aSelector]; 72 | } 73 | return signature; 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # EurekaCreditCard 2 | 3 | [![Version](https://img.shields.io/cocoapods/v/EurekaCreditCard.svg?style=flat)](http://cocoapods.org/pods/EurekaCreditCard) 4 | [![License](https://img.shields.io/cocoapods/l/EurekaCreditCard.svg?style=flat)](http://cocoapods.org/pods/EurekaCreditCard) 5 | [![Platform](https://img.shields.io/cocoapods/p/EurekaCreditCard.svg?style=flat)](http://cocoapods.org/pods/EurekaCreditCard) 6 | 7 | ## Usage 8 | 9 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 10 | 11 | ## Requirements 12 | 13 | ## Installation 14 | 15 | EurekaCreditCard is available through [CocoaPods](http://cocoapods.org). To install 16 | it, simply add the following line to your Podfile: 17 | 18 | ```ruby 19 | pod "EurekaCreditCard" 20 | ``` 21 | 22 | ## Code 23 | ```swift 24 | form +++= Section("Credit card information") 25 | 26 | <<< CreditCardRow() { 27 | //$0.title = "Card" 28 | $0.cardNumberPlaceholder = "Card Number" 29 | $0.expirationMonthPlaceholder = "MM" 30 | $0.expirationYearPlaceholder = "YY" 31 | $0.cvcPlaceholder = "CVC" 32 | //$0.dataSectionWidthPercentage = CGFloat(0.5) 33 | // $0.value = CreditCard() 34 | $0.value = CreditCard( 35 | cardNumber: "1", 36 | expirationMonth: "02", 37 | expirationYear: "2018", 38 | cvc: "4" 39 | ) 40 | } 41 | ``` 42 | 43 | ## Screenshots 44 | 45 | ##### Styles 46 | ![Styles](demo_styles.png) 47 | 48 | ##### Selectors for month and year 49 | ![Selectors for month and year](demo_selector.png) 50 | 51 | ### TODO 52 | * Swift 3 version 53 | * SwiftValidator integration? 54 | 55 | ## Author 56 | 57 | Demetrio Filocamo, filocamo@demetrio.it 58 | 59 | ## License 60 | 61 | EurekaCreditCard is available under the MIT license. See the LICENSE file for more info. 62 | -------------------------------------------------------------------------------- /Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCasePlatform.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #import 12 | #import 13 | #import 14 | 15 | BOOL FBSnapshotTestCaseIs64Bit(void) 16 | { 17 | #if __LP64__ 18 | return YES; 19 | #else 20 | return NO; 21 | #endif 22 | } 23 | 24 | NSOrderedSet *FBSnapshotTestCaseDefaultSuffixes(void) 25 | { 26 | NSMutableOrderedSet *suffixesSet = [[NSMutableOrderedSet alloc] init]; 27 | [suffixesSet addObject:@"_32"]; 28 | [suffixesSet addObject:@"_64"]; 29 | if (FBSnapshotTestCaseIs64Bit()) { 30 | return [suffixesSet reversedOrderedSet]; 31 | } 32 | return [suffixesSet copy]; 33 | } 34 | 35 | NSString *FBDeviceAgnosticNormalizedFileName(NSString *fileName) 36 | { 37 | UIDevice *device = [UIDevice currentDevice]; 38 | UIWindow *keyWindow = [[UIApplication sharedApplication] fb_strictKeyWindow]; 39 | CGSize screenSize = keyWindow.bounds.size; 40 | NSString *os = device.systemVersion; 41 | 42 | fileName = [NSString stringWithFormat:@"%@_%@%@_%.0fx%.0f", fileName, device.model, os, screenSize.width, screenSize.height]; 43 | 44 | NSMutableCharacterSet *invalidCharacters = [NSMutableCharacterSet new]; 45 | [invalidCharacters formUnionWithCharacterSet:[NSCharacterSet whitespaceCharacterSet]]; 46 | [invalidCharacters formUnionWithCharacterSet:[NSCharacterSet punctuationCharacterSet]]; 47 | NSArray *validComponents = [fileName componentsSeparatedByCharactersInSet:invalidCharacters]; 48 | fileName = [validComponents componentsJoinedByString:@"_"]; 49 | 50 | return fileName; 51 | } -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/Common/DateInlineFieldRow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DateInlineFieldRow.swift 3 | // Eureka 4 | // 5 | // Created by Martin Barreto on 2/24/16. 6 | // Copyright © 2016 Xmartlabs. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | public class DateInlineCell : Cell, CellType { 13 | 14 | public required init(style: UITableViewCellStyle, reuseIdentifier: String?) { 15 | super.init(style: style, reuseIdentifier: reuseIdentifier) 16 | } 17 | 18 | public override func setup() { 19 | super.setup() 20 | accessoryType = .None 21 | editingAccessoryType = .None 22 | } 23 | 24 | public override func update() { 25 | super.update() 26 | selectionStyle = row.isDisabled ? .None : .Default 27 | } 28 | 29 | public override func didSelect() { 30 | super.didSelect() 31 | row.deselect() 32 | } 33 | } 34 | 35 | 36 | public class _DateInlineFieldRow: Row, DatePickerRowProtocol, NoValueDisplayTextConformance { 37 | 38 | /// The minimum value for this row's UIDatePicker 39 | public var minimumDate : NSDate? 40 | 41 | /// The maximum value for this row's UIDatePicker 42 | public var maximumDate : NSDate? 43 | 44 | /// The interval between options for this row's UIDatePicker 45 | public var minuteInterval : Int? 46 | 47 | /// The formatter for the date picked by the user 48 | public var dateFormatter: NSDateFormatter? 49 | 50 | public var noValueDisplayText: String? 51 | 52 | required public init(tag: String?) { 53 | super.init(tag: tag) 54 | dateFormatter = NSDateFormatter() 55 | dateFormatter?.locale = .currentLocale() 56 | displayValueFor = { [unowned self] value in 57 | guard let val = value, let formatter = self.dateFormatter else { return nil } 58 | return formatter.stringFromDate(val) 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/CheckRow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CheckRow.swift 3 | // Eureka 4 | // 5 | // Created by Martin Barreto on 2/23/16. 6 | // Copyright © 2016 Xmartlabs. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | // MARK: CheckCell 12 | 13 | public final class CheckCell : Cell, CellType { 14 | 15 | required public init(style: UITableViewCellStyle, reuseIdentifier: String?) { 16 | super.init(style: style, reuseIdentifier: reuseIdentifier) 17 | } 18 | 19 | public override func update() { 20 | super.update() 21 | accessoryType = row.value == true ? .Checkmark : .None 22 | editingAccessoryType = accessoryType 23 | selectionStyle = .Default 24 | var red: CGFloat = 0, green: CGFloat = 0, blue: CGFloat = 0, alpha: CGFloat = 0 25 | tintColor.getRed(&red, green: &green, blue: &blue, alpha: &alpha) 26 | if row.isDisabled { 27 | tintColor = UIColor(red: red, green: green, blue: blue, alpha: 0.3) 28 | selectionStyle = .None 29 | } 30 | else { 31 | tintColor = UIColor(red: red, green: green, blue: blue, alpha: 1) 32 | } 33 | } 34 | 35 | public override func setup() { 36 | super.setup() 37 | accessoryType = .Checkmark 38 | editingAccessoryType = accessoryType 39 | } 40 | 41 | public override func didSelect() { 42 | row.value = row.value ?? false ? false : true 43 | row.deselect() 44 | row.updateCell() 45 | } 46 | 47 | } 48 | 49 | // MARK: CheckRow 50 | 51 | public class _CheckRow: Row { 52 | 53 | required public init(tag: String?) { 54 | super.init(tag: tag) 55 | displayValueFor = nil 56 | } 57 | } 58 | 59 | ///// Boolean row that has a checkmark as accessoryType 60 | public final class CheckRow: _CheckRow, RowType { 61 | 62 | required public init(tag: String?) { 63 | super.init(tag: tag) 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/AlertRow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AlertRow.swift 3 | // Eureka 4 | // 5 | // Created by Martin Barreto on 2/23/16. 6 | // Copyright © 2016 Xmartlabs. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | public class _AlertRow: OptionsRow, PresenterRowType { 13 | 14 | public var onPresentCallback : ((FormViewController, SelectorAlertController)->())? 15 | lazy public var presentationMode: PresentationMode>? = { 16 | return .PresentModally(controllerProvider: ControllerProvider.Callback { [weak self] in 17 | let vc = SelectorAlertController(title: self?.selectorTitle, message: nil, preferredStyle: .Alert) 18 | vc.row = self 19 | return vc 20 | }, completionCallback: { [weak self] in 21 | $0.dismissViewControllerAnimated(true, completion: nil) 22 | self?.cell?.formViewController()?.tableView?.reloadData() 23 | } 24 | ) 25 | }() 26 | 27 | public required init(tag: String?) { 28 | super.init(tag: tag) 29 | } 30 | 31 | public override func customDidSelect() { 32 | super.customDidSelect() 33 | if let presentationMode = presentationMode where !isDisabled { 34 | if let controller = presentationMode.createController(){ 35 | controller.row = self 36 | onPresentCallback?(cell.formViewController()!, controller) 37 | presentationMode.presentViewController(controller, row: self, presentingViewController: cell.formViewController()!) 38 | } 39 | else{ 40 | presentationMode.presentViewController(nil, row: self, presentingViewController: cell.formViewController()!) 41 | } 42 | } 43 | } 44 | } 45 | 46 | /// An options row where the user can select an option from a modal Alert 47 | public final class AlertRow: _AlertRow>, RowType { 48 | required public init(tag: String?) { 49 | super.init(tag: tag) 50 | } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/PickerInlineRow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PickerInlineRow.swift 3 | // Eureka 4 | // 5 | // Created by Martin Barreto on 2/23/16. 6 | // Copyright © 2016 Xmartlabs. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class PickerInlineCell : Cell, CellType { 12 | 13 | required public init(style: UITableViewCellStyle, reuseIdentifier: String?) { 14 | super.init(style: style, reuseIdentifier: reuseIdentifier) 15 | } 16 | 17 | public override func setup() { 18 | super.setup() 19 | accessoryType = .None 20 | editingAccessoryType = .None 21 | } 22 | 23 | public override func update() { 24 | super.update() 25 | selectionStyle = row.isDisabled ? .None : .Default 26 | } 27 | 28 | public override func didSelect() { 29 | super.didSelect() 30 | row.deselect() 31 | } 32 | } 33 | 34 | //MARK: PickerInlineRow 35 | 36 | public class _PickerInlineRow : Row>, NoValueDisplayTextConformance { 37 | 38 | public typealias InlineRow = PickerRow 39 | public var options = [T]() 40 | public var noValueDisplayText: String? 41 | 42 | required public init(tag: String?) { 43 | super.init(tag: tag) 44 | } 45 | } 46 | 47 | /// A generic inline row where the user can pick an option from a picker view 48 | public final class PickerInlineRow : _PickerInlineRow, RowType, InlineRowType { 49 | 50 | required public init(tag: String?) { 51 | super.init(tag: tag) 52 | onExpandInlineRow { cell, row, _ in 53 | let color = cell.detailTextLabel?.textColor 54 | row.onCollapseInlineRow { cell, _, _ in 55 | cell.detailTextLabel?.textColor = color 56 | } 57 | cell.detailTextLabel?.textColor = cell.tintColor 58 | } 59 | } 60 | 61 | public override func customDidSelect() { 62 | super.customDidSelect() 63 | if !isDisabled { 64 | toggleInlineRow() 65 | } 66 | } 67 | 68 | public func setupInlineRow(inlineRow: InlineRow) { 69 | inlineRow.options = self.options 70 | inlineRow.displayValueFor = self.displayValueFor 71 | } 72 | } 73 | 74 | -------------------------------------------------------------------------------- /Example/EurekaCreditCard/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // EurekaCreditCard 4 | // 5 | // Created by Demetrio Filocamo on 04/02/2016. 6 | // Copyright (c) 2016 Demetrio Filocamo. 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 | return true 20 | } 21 | 22 | func applicationWillResignActive(application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(application: UIApplication) { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Core/PresenterRowType.swift: -------------------------------------------------------------------------------- 1 | // PresenterRowType.swift 2 | // Eureka ( https://github.com/xmartlabs/Eureka ) 3 | // 4 | // Copyright (c) 2016 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 Foundation 27 | 28 | /** 29 | * Protocol that every row that displays a new view controller must conform to. 30 | * This includes presenting or pushing view controllers. 31 | */ 32 | public protocol PresenterRowType: TypedRowType { 33 | 34 | associatedtype ProviderType : UIViewController, TypedRowControllerType 35 | 36 | /// Defines how the view controller will be presented, pushed, etc. 37 | var presentationMode: PresentationMode? { get set } 38 | 39 | /// Will be called before the presentation occurs. 40 | var onPresentCallback: ((FormViewController, ProviderType)->())? { get set } 41 | } 42 | 43 | extension PresenterRowType { 44 | 45 | /** 46 | Sets a block to be executed when the row presents a view controller 47 | 48 | - parameter callback: the block 49 | 50 | - returns: this row 51 | */ 52 | public func onPresent(callback: (FormViewController, ProviderType)->()) -> Self { 53 | onPresentCallback = callback 54 | return self 55 | } 56 | } -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/EurekaCreditCard.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 | -------------------------------------------------------------------------------- /Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Snapshot.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #import 12 | #import 13 | 14 | @implementation UIImage (Snapshot) 15 | 16 | + (UIImage *)fb_imageForLayer:(CALayer *)layer 17 | { 18 | CGRect bounds = layer.bounds; 19 | NSAssert1(CGRectGetWidth(bounds), @"Zero width for layer %@", layer); 20 | NSAssert1(CGRectGetHeight(bounds), @"Zero height for layer %@", layer); 21 | 22 | UIGraphicsBeginImageContextWithOptions(bounds.size, NO, 0); 23 | CGContextRef context = UIGraphicsGetCurrentContext(); 24 | NSAssert1(context, @"Could not generate context for layer %@", layer); 25 | CGContextSaveGState(context); 26 | [layer layoutIfNeeded]; 27 | [layer renderInContext:context]; 28 | CGContextRestoreGState(context); 29 | 30 | UIImage *snapshot = UIGraphicsGetImageFromCurrentImageContext(); 31 | UIGraphicsEndImageContext(); 32 | return snapshot; 33 | } 34 | 35 | + (UIImage *)fb_imageForViewLayer:(UIView *)view 36 | { 37 | [view layoutIfNeeded]; 38 | return [self fb_imageForLayer:view.layer]; 39 | } 40 | 41 | + (UIImage *)fb_imageForView:(UIView *)view 42 | { 43 | CGRect bounds = view.bounds; 44 | NSAssert1(CGRectGetWidth(bounds), @"Zero width for view %@", view); 45 | NSAssert1(CGRectGetHeight(bounds), @"Zero height for view %@", view); 46 | 47 | // If the input view is already a UIWindow, then just use that. Otherwise wrap in a window. 48 | UIWindow *window = [view isKindOfClass:[UIWindow class]] ? (UIWindow *)view : view.window; 49 | BOOL removeFromSuperview = NO; 50 | if (!window) { 51 | window = [[UIApplication sharedApplication] fb_strictKeyWindow]; 52 | } 53 | 54 | if (!view.window && view != window) { 55 | [window addSubview:view]; 56 | removeFromSuperview = YES; 57 | } 58 | 59 | UIGraphicsBeginImageContextWithOptions(bounds.size, NO, 0); 60 | [view layoutIfNeeded]; 61 | [view drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES]; 62 | 63 | UIImage *snapshot = UIGraphicsGetImageFromCurrentImageContext(); 64 | UIGraphicsEndImageContext(); 65 | 66 | if (removeFromSuperview) { 67 | [view removeFromSuperview]; 68 | } 69 | 70 | return snapshot; 71 | } 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/Categories/UIImage+Diff.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Gabriel Handford on 3/1/09. 3 | // Copyright 2009-2013. All rights reserved. 4 | // Created by John Boiles on 10/20/11. 5 | // Copyright (c) 2011. All rights reserved 6 | // Modified by Felix Schulze on 2/11/13. 7 | // Copyright 2013. All rights reserved. 8 | // 9 | // Permission is hereby granted, free of charge, to any person 10 | // obtaining a copy of this software and associated documentation 11 | // files (the "Software"), to deal in the Software without 12 | // restriction, including without limitation the rights to use, 13 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | // copies of the Software, and to permit persons to whom the 15 | // Software is furnished to do so, subject to the following 16 | // conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be 19 | // included in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 22 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 23 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 24 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 25 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 26 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 27 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 28 | // OTHER DEALINGS IN THE SOFTWARE. 29 | // 30 | 31 | #import 32 | 33 | @implementation UIImage (Diff) 34 | 35 | - (UIImage *)fb_diffWithImage:(UIImage *)image 36 | { 37 | if (!image) { 38 | return nil; 39 | } 40 | CGSize imageSize = CGSizeMake(MAX(self.size.width, image.size.width), MAX(self.size.height, image.size.height)); 41 | UIGraphicsBeginImageContextWithOptions(imageSize, YES, 0); 42 | CGContextRef context = UIGraphicsGetCurrentContext(); 43 | [self drawInRect:CGRectMake(0, 0, self.size.width, self.size.height)]; 44 | CGContextSetAlpha(context, 0.5); 45 | CGContextBeginTransparencyLayer(context, NULL); 46 | [image drawInRect:CGRectMake(0, 0, image.size.width, image.size.height)]; 47 | CGContextSetBlendMode(context, kCGBlendModeDifference); 48 | CGContextSetFillColorWithColor(context,[UIColor whiteColor].CGColor); 49 | CGContextFillRect(context, CGRectMake(0, 0, self.size.width, self.size.height)); 50 | CGContextEndTransparencyLayer(context); 51 | UIImage *returnImage = UIGraphicsGetImageFromCurrentImageContext(); 52 | UIGraphicsEndImageContext(); 53 | return returnImage; 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Example/EurekaCreditCard/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // EurekaCreditCard 4 | // 5 | // Created by Demetrio Filocamo on 04/02/2016. 6 | // Copyright (c) 2016 Demetrio Filocamo. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Eureka 11 | import EurekaCreditCard 12 | 13 | class ViewController: FormViewController { 14 | 15 | override func viewDidLoad() { 16 | super.viewDidLoad() 17 | // Do any additional setup after loading the view, typically from a nib. 18 | 19 | form +++ Section("Credit card information") 20 | 21 | <<< CreditCardRow() { 22 | //$0.title = "Card" 23 | //$0.dataSectionWidthPercentage = CGFloat(0.5) 24 | $0.cardNumberPlaceholder = "Card Number" 25 | $0.expirationMonthPlaceholder = "MM" 26 | $0.expirationYearPlaceholder = "YYYY" 27 | $0.cvcPlaceholder = "CVC" 28 | $0.value = CreditCard() 29 | } 30 | 31 | form +++ Section("Credit card information (Example 2)") 32 | <<< CreditCardRow() { 33 | $0.title = "Card" 34 | //$0.dataSectionWidthPercentage = CGFloat(0.5) 35 | $0.cardNumberPlaceholder = "Card Number" 36 | $0.expirationMonthPlaceholder = "MM" 37 | $0.expirationYearPlaceholder = "YYYY" 38 | $0.cvcPlaceholder = "CVC" 39 | $0.value = CreditCard( 40 | cardNumber: "4242424242424242", 41 | expirationMonth: "02", 42 | expirationYear: "2018", 43 | cvc: "123" 44 | ) 45 | } 46 | 47 | form +++ Section("Credit card information (Example 3)") 48 | <<< CreditCardRow() { 49 | $0.title = "Main Card" 50 | $0.dataSectionWidthPercentage = CGFloat(0.6) 51 | $0.cardNumberPlaceholder = "Card Number" 52 | $0.expirationMonthPlaceholder = "MM" 53 | $0.expirationYearPlaceholder = "YYYY" 54 | $0.cvcPlaceholder = "CVC" 55 | $0.value = CreditCard( 56 | cardNumber: "4242424242424242", 57 | expirationMonth: "02", 58 | expirationYear: "2018", 59 | cvc: "123" 60 | ) 61 | } 62 | } 63 | 64 | override func didReceiveMemoryWarning() { 65 | super.didReceiveMemoryWarning() 66 | // Dispose of any resources that can be recreated. 67 | } 68 | 69 | 70 | } 71 | 72 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/Controllers/SelectorViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SelectorViewController.swift 3 | // Eureka 4 | // 5 | // Created by Martin Barreto on 2/24/16. 6 | // Copyright © 2016 Xmartlabs. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class _SelectorViewController: FormViewController, TypedRowControllerType { 12 | 13 | /// The row that pushed or presented this controller 14 | public var row: RowOf! 15 | 16 | /// A closure to be called when the controller disappears. 17 | public var completionCallback : ((UIViewController) -> ())? 18 | 19 | public var selectableRowCellUpdate: ((cell: Row.Cell, row: Row) -> ())? 20 | 21 | override public init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) { 22 | super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) 23 | } 24 | 25 | public override func viewDidLoad() { 26 | super.viewDidLoad() 27 | guard let options = row.dataProvider?.arrayData else { return } 28 | 29 | form +++ SelectableSection(row.title ?? "", selectionType: .SingleSelection(enableDeselection: true)) { [weak self] section in 30 | if let sec = section as? SelectableSection { 31 | sec.onSelectSelectableRow = { _, row in 32 | self?.row.value = row.value 33 | self?.completionCallback?(self!) 34 | } 35 | } 36 | } 37 | for option in options { 38 | form.first! <<< Row.init(String(option)){ lrow in 39 | lrow.title = row.displayValueFor?(option) 40 | lrow.selectableValue = option 41 | lrow.value = row.value == option ? option : nil 42 | }.cellUpdate { [weak self] cell, row in 43 | self?.selectableRowCellUpdate?(cell: cell, row: row) 44 | } 45 | } 46 | } 47 | } 48 | 49 | /// Selector Controller (used to select one option among a list) 50 | public class SelectorViewController : _SelectorViewController> { 51 | 52 | override public init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) { 53 | super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) 54 | } 55 | 56 | convenience public init(_ callback: (UIViewController) -> ()){ 57 | self.init(nibName: nil, bundle: nil) 58 | completionCallback = callback 59 | } 60 | 61 | 62 | } 63 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Core/RowProtocols.swift: -------------------------------------------------------------------------------- 1 | // RowProtocols.swift 2 | // Eureka ( https://github.com/xmartlabs/Eureka ) 3 | // 4 | // Copyright (c) 2016 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 Foundation 27 | 28 | 29 | /** 30 | * Protocol that view controllers pushed or presented by a row should conform to. 31 | */ 32 | public protocol TypedRowControllerType : RowControllerType { 33 | associatedtype RowValue: Equatable 34 | 35 | /// The row that pushed or presented this controller 36 | var row : RowOf! { get set } 37 | } 38 | 39 | 40 | 41 | //MARK: Header Footer Protocols 42 | 43 | /** 44 | * Protocol used to set headers and footers to sections. 45 | * Can be set with a view or a String 46 | */ 47 | public protocol HeaderFooterViewRepresentable { 48 | 49 | /** 50 | This method can be called to get the view corresponding to the header or footer of a section in a specific controller. 51 | 52 | - parameter section: The section from which to get the view. 53 | - parameter type: Either header or footer. 54 | - parameter controller: The controller from which to get that view. 55 | 56 | - returns: The header or footer of the specified section. 57 | */ 58 | func viewForSection(section: Section, type: HeaderFooterType) -> UIView? 59 | 60 | /// If the header or footer of a section was created with a String then it will be stored in the title. 61 | var title: String? { get set } 62 | 63 | /// The height of the header or footer. 64 | var height: (()->CGFloat)? { get set } 65 | } 66 | 67 | 68 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/Common/SelectorRow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SelectorRow.swift 3 | // Eureka 4 | // 5 | // Created by Martin Barreto on 2/23/16. 6 | // Copyright © 2016 Xmartlabs. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class PushSelectorCell : Cell, CellType { 12 | 13 | required public init(style: UITableViewCellStyle, reuseIdentifier: String?) { 14 | super.init(style: style, reuseIdentifier: reuseIdentifier) 15 | } 16 | 17 | public override func update() { 18 | super.update() 19 | accessoryType = .DisclosureIndicator 20 | editingAccessoryType = accessoryType 21 | selectionStyle = row.isDisabled ? .None : .Default 22 | } 23 | } 24 | 25 | /// Generic row type where a user must select a value among several options. 26 | public class SelectorRow: OptionsRow, PresenterRowType { 27 | 28 | /// Defines how the view controller will be presented, pushed, etc. 29 | public var presentationMode: PresentationMode? 30 | 31 | /// Will be called before the presentation occurs. 32 | public var onPresentCallback : ((FormViewController, VCType)->())? 33 | 34 | required public init(tag: String?) { 35 | super.init(tag: tag) 36 | } 37 | 38 | /** 39 | Extends `didSelect` method 40 | */ 41 | public override func customDidSelect() { 42 | super.customDidSelect() 43 | guard let presentationMode = presentationMode where !isDisabled else { return } 44 | if let controller = presentationMode.createController(){ 45 | controller.row = self 46 | controller.title = selectorTitle ?? controller.title 47 | onPresentCallback?(cell.formViewController()!, controller) 48 | presentationMode.presentViewController(controller, row: self, presentingViewController: self.cell.formViewController()!) 49 | } 50 | else{ 51 | presentationMode.presentViewController(nil, row: self, presentingViewController: self.cell.formViewController()!) 52 | } 53 | } 54 | 55 | /** 56 | Prepares the pushed row setting its title and completion callback. 57 | */ 58 | public override func prepareForSegue(segue: UIStoryboardSegue) { 59 | super.prepareForSegue(segue) 60 | guard let rowVC = segue.destinationViewController as? VCType else { return } 61 | rowVC.title = selectorTitle ?? rowVC.title 62 | rowVC.completionCallback = presentationMode?.completionHandler ?? rowVC.completionCallback 63 | onPresentCallback?(cell.formViewController()!, rowVC) 64 | rowVC.row = self 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/StepperRow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StepperRow.swift 3 | // Eureka 4 | // 5 | // Created by Andrew Holt on 3/4/16. 6 | // Copyright © 2016 Xmartlabs. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | // MARK: StepperCell 12 | 13 | public class StepperCell : Cell, CellType { 14 | 15 | public typealias Value = Double 16 | 17 | required public init(style: UITableViewCellStyle, reuseIdentifier: String?) { 18 | super.init(style: style, reuseIdentifier: reuseIdentifier) 19 | height = { BaseRow.estimatedRowHeight } 20 | } 21 | 22 | public lazy var stepper: UIStepper = { 23 | let s = UIStepper() 24 | s.translatesAutoresizingMaskIntoConstraints = false 25 | return s 26 | }() 27 | 28 | public lazy var valueLabel: UILabel = { 29 | let l = UILabel() 30 | l.translatesAutoresizingMaskIntoConstraints = false 31 | l.numberOfLines = 1 32 | return l 33 | }() 34 | 35 | public override func setup() { 36 | super.setup() 37 | selectionStyle = .None 38 | 39 | addSubview(stepper) 40 | addSubview(valueLabel) 41 | 42 | addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:[v]-[s]-|", options: .AlignAllCenterY, metrics: nil, views: ["s": stepper, "v": valueLabel])) 43 | addConstraint(NSLayoutConstraint(item: stepper, attribute: .CenterY, relatedBy: .Equal, toItem: contentView, attribute: .CenterY, multiplier: 1.0, constant: 0)) 44 | addConstraint(NSLayoutConstraint(item: valueLabel, attribute: .CenterY, relatedBy: .Equal, toItem: stepper, attribute: .CenterY, multiplier: 1.0, constant: 0)) 45 | 46 | valueLabel.textColor = stepper.tintColor 47 | 48 | stepper.addTarget(self, action: #selector(StepperCell.valueChanged), forControlEvents: .ValueChanged) 49 | } 50 | 51 | deinit { 52 | stepper.removeTarget(self, action: nil, forControlEvents: .AllEvents) 53 | } 54 | 55 | public override func update() { 56 | super.update() 57 | stepper.value = row.value ?? 0 58 | valueLabel.text = "\(row.value ?? 0)" 59 | stepper.enabled = !row.isDisabled 60 | stepper.alpha = row.isDisabled ? 0.3 : 1.0 61 | valueLabel.alpha = row.isDisabled ? 0.3 : 1.0 62 | } 63 | 64 | func valueChanged() { 65 | valueLabel.text = "\(stepper.value)" 66 | row.value = stepper.value 67 | } 68 | } 69 | 70 | // MARK: StepperRow 71 | 72 | public class _StepperRow: Row { 73 | required public init(tag: String?) { 74 | super.init(tag: tag) 75 | displayValueFor = nil 76 | } 77 | } 78 | 79 | 80 | /// Double row that has a UIStepper as accessoryType 81 | public final class StepperRow: _StepperRow, RowType { 82 | required public init(tag: String?) { 83 | super.init(tag: tag) 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Example/Pods/BKMoneyKit/README.md: -------------------------------------------------------------------------------- 1 | BKMoneyKit 2 | ========== 3 | 4 | iOS UI controls and formatters for entering money, credit card number and expiry date. 5 | 6 | Card logo images by http://www.shopify.com/blog/6335014-32-free-credit-card-icons 7 | 8 | ## Screenshots 9 | ![Screenshot](./Screenshots/money_kit_01.png) 10 | ![Screenshot](./Screenshots/money_kit_02.png) 11 | 12 | 13 | ## Classes 14 | | Class | Description | 15 | | ----- | ----------- | 16 | | ```BKCardNumberField``` | Subclass of UITextField that supports formatting card number. You can show card logo image by setting ```showsCardLogo``` to ```YES```. | 17 | | ```BKCardNumberLabel``` | Subclass of UILabel that displays formatted card number and card brand logo. You can mask card number by configuring ```cardNumberFormatter```. | 18 | | ```BKCardNumberFormatter``` | Subclass of NSFormatter. This class has card number pattern information inside and formats according to patterns. You can customize masking behavior, masking character and group separater character. | 19 | | ```BKCardExpiryField``` | Subclass of UITextField that supports formatting card number expiry date. | 20 | | ```BKCurrencyTextField``` | Subclass of UITextField that supports formatting money amount. You can change currency by changing the ```currencyCode``` property of ```numberFormatter```. | 21 | 22 | 23 | ## Examples 24 | 25 | ### BKCardNumberField 26 | 27 | ```objc 28 | // create (you can also use interface builder) 29 | BKCardNumberField *cardNumberField = [[BKCardNumberField alloc] initWithFrame:CGRectMake(0, 0, 300, 40)]; 30 | cardNumberField.showsCardLogo = YES; 31 | [self.view addSubview:cardNumberField]; 32 | 33 | // get card number 34 | NSString *cardNumber = cardNumberField.cardNumber; 35 | 36 | // get card company name 37 | NSString *companyName = cardNumberField.cardCompanyName; 38 | ``` 39 | 40 | ### BKCardNumberLabel 41 | ```objc 42 | 43 | BKCardNumberLabel *cardNumberLabel = [[BKCardNumberLabel alloc] initWithFrame:CGRectMake(0, 0, 300, 40)]; 44 | // set masking character. BLACK CIRCLE (0x25CF) 45 | cardNumberLabel.cardNumberFormatter.maskingCharacter = @"●"; 46 | // masking second and third group. 47 | cardNumberLabel.cardNumberFormatter.maskingGroupIndexSet = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(1, 2)]; 48 | 49 | ``` 50 | 51 | ### BKCardExpiryField 52 | 53 | ```objc 54 | BKCardExpiryField *field = [[BKCardExpiryField alloc] init]; 55 | 56 | // get month 57 | NSInteger month = field.dateComponents.month; 58 | 59 | // get year 60 | NSInteger year = field.dateComponents.year; 61 | ``` 62 | 63 | ### BKCurrencyTextField 64 | 65 | ```objc 66 | BKCurrencyTextField *field = [[BKCurrencyTextField alloc] init]; 67 | 68 | // change currency 69 | field.numberFormatter.currencyCode = @"KRW"; 70 | 71 | // get number value 72 | NSDecimalNumber *number = field.numberValue; 73 | ``` 74 | 75 | ### Custom cards images 76 | 77 | Just add to your image assets the card logo with the shortName eg. "visa", "amex", "mastercard" etc.. 78 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/Controllers/MultipleSelectorViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MultipleSelectorViewController.swift 3 | // Eureka 4 | // 5 | // Created by Martin Barreto on 2/24/16. 6 | // Copyright © 2016 Xmartlabs. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | /// Selector Controller that enables multiple selection 13 | public class _MultipleSelectorViewController : FormViewController, TypedRowControllerType { 14 | 15 | /// The row that pushed or presented this controller 16 | public var row: RowOf>! 17 | 18 | public var selectableRowCellSetup: ((cell: Row.Cell, row: Row) -> ())? 19 | public var selectableRowCellUpdate: ((cell: Row.Cell, row: Row) -> ())? 20 | 21 | /// A closure to be called when the controller disappears. 22 | public var completionCallback : ((UIViewController) -> ())? 23 | 24 | override public init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) { 25 | super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) 26 | } 27 | 28 | convenience public init(_ callback: (UIViewController) -> ()){ 29 | self.init(nibName: nil, bundle: nil) 30 | completionCallback = callback 31 | } 32 | 33 | public override func viewDidLoad() { 34 | super.viewDidLoad() 35 | guard let options = row.dataProvider?.arrayData else { return } 36 | form +++ SelectableSection(row.title ?? "", selectionType: .MultipleSelection) { [weak self] section in 37 | if let sec = section as? SelectableSection { 38 | sec.onSelectSelectableRow = { _, selectableRow in 39 | var newValue: Set = self?.row.value ?? [] 40 | if let selectableValue = selectableRow.value { 41 | newValue.insert(selectableValue) 42 | } 43 | else { 44 | newValue.remove(selectableRow.selectableValue!) 45 | } 46 | self?.row.value = newValue 47 | } 48 | } 49 | } 50 | for o in options { 51 | form.first! <<< Row.init() { [weak self] in 52 | $0.title = String(o.first!) 53 | $0.selectableValue = o.first! 54 | $0.value = self?.row.value?.contains(o.first!) ?? false ? o.first! : nil 55 | }.cellSetup { [weak self] cell, row in 56 | self?.selectableRowCellSetup?(cell: cell, row: row) 57 | }.cellUpdate { [weak self] cell, row in 58 | self?.selectableRowCellUpdate?(cell: cell, row: row) 59 | } 60 | 61 | } 62 | form.first?.header = HeaderFooterView(title: row.title) 63 | } 64 | 65 | } 66 | 67 | 68 | public class MultipleSelectorViewController : _MultipleSelectorViewController> { 69 | } 70 | 71 | 72 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/Common/GenericMultipleSelectorRow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GenericMultipleSelectorRow.swift 3 | // Eureka 4 | // 5 | // Created by Martin Barreto on 2/24/16. 6 | // Copyright © 2016 Xmartlabs. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | 13 | /// Generic options selector row that allows multiple selection. 14 | public class GenericMultipleSelectorRow, VCType: UIViewController, VCType.RowValue == Set>: Row, Cell>, PresenterRowType, NoValueDisplayTextConformance { 15 | 16 | /// Defines how the view controller will be presented, pushed, etc. 17 | public var presentationMode: PresentationMode? 18 | 19 | /// Will be called before the presentation occurs. 20 | public var onPresentCallback : ((FormViewController, VCType)->())? 21 | 22 | /// Title to be displayed for the options 23 | public var selectorTitle: String? 24 | 25 | public var noValueDisplayText: String? 26 | 27 | /// Options from which the user will choose 28 | public var options: [T] { 29 | get { return self.dataProvider?.arrayData?.map({ $0.first! }) ?? [] } 30 | set { self.dataProvider = DataProvider(arrayData: newValue.map({ Set(arrayLiteral: $0) })) } 31 | } 32 | 33 | required public init(tag: String?) { 34 | super.init(tag: tag) 35 | displayValueFor = { (rowValue: Set?) in 36 | return rowValue?.map({ String($0) }).sort().joinWithSeparator(", ") 37 | } 38 | presentationMode = .Show(controllerProvider: ControllerProvider.Callback { return VCType() }, completionCallback: { vc in vc.navigationController?.popViewControllerAnimated(true) }) 39 | } 40 | 41 | /** 42 | Extends `didSelect` method 43 | */ 44 | public override func customDidSelect() { 45 | super.customDidSelect() 46 | guard let presentationMode = presentationMode where !isDisabled else { return } 47 | if let controller = presentationMode.createController(){ 48 | controller.row = self 49 | controller.title = selectorTitle ?? controller.title 50 | onPresentCallback?(cell.formViewController()!, controller) 51 | presentationMode.presentViewController(controller, row: self, presentingViewController: self.cell.formViewController()!) 52 | } 53 | else{ 54 | presentationMode.presentViewController(nil, row: self, presentingViewController: self.cell.formViewController()!) 55 | } 56 | } 57 | 58 | /** 59 | Prepares the pushed row setting its title and completion callback. 60 | */ 61 | public override func prepareForSegue(segue: UIStoryboardSegue) { 62 | super.prepareForSegue(segue) 63 | guard let rowVC = segue.destinationViewController as? VCType else { return } 64 | rowVC.title = selectorTitle ?? rowVC.title 65 | rowVC.completionCallback = presentationMode?.completionHandler ?? rowVC.completionCallback 66 | onPresentCallback?(cell.formViewController()!, rowVC) 67 | rowVC.row = self 68 | } 69 | } 70 | 71 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Core/CellType.swift: -------------------------------------------------------------------------------- 1 | // CellType.swift 2 | // Eureka ( https://github.com/xmartlabs/Eureka ) 3 | // 4 | // Copyright (c) 2016 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 | import Foundation 26 | 27 | 28 | //MARK: Cell Protocols 29 | 30 | public protocol BaseCellType : class { 31 | 32 | /// Method that will return the height of the cell 33 | var height : (()->CGFloat)? { get } 34 | 35 | /** 36 | Method called once when creating a cell. Responsible for setting up the cell. 37 | */ 38 | func setup() 39 | 40 | /** 41 | Method called each time the cell is updated (e.g. 'cellForRowAtIndexPath' is called). Responsible for updating the cell. 42 | */ 43 | func update() 44 | 45 | /** 46 | Method called each time the cell is selected (tapped on by the user). 47 | */ 48 | func didSelect() 49 | 50 | /** 51 | Method called each time the cell is selected (tapped on by the user). 52 | */ 53 | func highlight() 54 | 55 | /** 56 | Method called each time the cell is deselected (looses first responder). 57 | */ 58 | func unhighlight() 59 | 60 | /** 61 | Called when cell is about to become first responder 62 | 63 | - returns: If the cell should become first responder. 64 | */ 65 | func cellCanBecomeFirstResponder() -> Bool 66 | 67 | /** 68 | Method called when the cell becomes first responder 69 | */ 70 | func cellBecomeFirstResponder(direction: Direction) -> Bool 71 | 72 | /** 73 | Method called when the cell resigns first responder 74 | */ 75 | func cellResignFirstResponder() -> Bool 76 | 77 | /** 78 | A reference to the controller in which the cell is displayed. 79 | */ 80 | func formViewController () -> FormViewController? 81 | } 82 | 83 | 84 | public protocol TypedCellType : BaseCellType { 85 | 86 | associatedtype Value: Equatable 87 | 88 | /// The row associated to this cell. 89 | var row : RowOf! { get set } 90 | } 91 | 92 | public protocol CellType {} 93 | 94 | 95 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Core/Helpers.swift: -------------------------------------------------------------------------------- 1 | // Helpers.swift 2 | // Eureka ( https://github.com/xmartlabs/Eureka ) 3 | // 4 | // Copyright (c) 2016 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 | import Foundation 26 | import UIKit 27 | 28 | extension UIView { 29 | 30 | public func findFirstResponder() -> UIView? { 31 | if isFirstResponder() { return self } 32 | for subView in subviews { 33 | if let firstResponder = subView.findFirstResponder() { 34 | return firstResponder 35 | } 36 | } 37 | return nil 38 | } 39 | 40 | public func formCell() -> BaseCell? { 41 | if self is UITableViewCell { 42 | return self as? BaseCell 43 | } 44 | return superview?.formCell() 45 | } 46 | } 47 | 48 | extension NSPredicate { 49 | 50 | var predicateVars: [String] { 51 | var ret = [String]() 52 | if let compoundPredicate = self as? NSCompoundPredicate { 53 | for subPredicate in compoundPredicate.subpredicates where subPredicate is NSPredicate { 54 | ret.appendContentsOf((subPredicate as! NSPredicate).predicateVars) 55 | } 56 | } 57 | else if let comparisonPredicate = self as? NSComparisonPredicate{ 58 | ret.appendContentsOf(comparisonPredicate.leftExpression.expressionVars) 59 | ret.appendContentsOf(comparisonPredicate.rightExpression.expressionVars) 60 | } 61 | return ret 62 | } 63 | } 64 | 65 | extension NSExpression { 66 | 67 | var expressionVars: [String] { 68 | switch expressionType{ 69 | case .FunctionExpressionType, .VariableExpressionType: 70 | let str = "\(self)" 71 | if let range = str.rangeOfString("."){ 72 | return [str.substringWithRange(str.startIndex.advancedBy(1).. : Cell, CellType, UIPickerViewDataSource, UIPickerViewDelegate{ 14 | 15 | public lazy var picker: UIPickerView = { [unowned self] in 16 | let picker = UIPickerView() 17 | picker.translatesAutoresizingMaskIntoConstraints = false 18 | self.contentView.addSubview(picker) 19 | self.contentView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|-0-[picker]-0-|", options: [], metrics: nil, views: ["picker": picker])) 20 | self.contentView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|-0-[picker]-0-|", options: [], metrics: nil, views: ["picker": picker])) 21 | return picker 22 | }() 23 | 24 | private var pickerRow : _PickerRow? { return row as? _PickerRow } 25 | 26 | public required init(style: UITableViewCellStyle, reuseIdentifier: String?){ 27 | super.init(style: style, reuseIdentifier: reuseIdentifier) 28 | } 29 | 30 | public override func setup() { 31 | super.setup() 32 | accessoryType = .None 33 | editingAccessoryType = .None 34 | picker.delegate = self 35 | picker.dataSource = self 36 | } 37 | 38 | deinit { 39 | picker.delegate = nil 40 | picker.dataSource = nil 41 | } 42 | 43 | public override func update(){ 44 | super.update() 45 | textLabel?.text = nil 46 | detailTextLabel?.text = nil 47 | picker.reloadAllComponents() 48 | if let selectedValue = pickerRow?.value, let index = pickerRow?.options.indexOf(selectedValue){ 49 | picker.selectRow(index, inComponent: 0, animated: true) 50 | } 51 | } 52 | 53 | public func numberOfComponentsInPickerView(pickerView: UIPickerView) -> Int { 54 | return 1 55 | } 56 | 57 | public func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { 58 | return pickerRow?.options.count ?? 0 59 | } 60 | 61 | public func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? { 62 | return pickerRow?.displayValueFor?(pickerRow?.options[row]) 63 | } 64 | 65 | public func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) { 66 | if let picker = pickerRow where !picker.options.isEmpty { 67 | picker.value = picker.options[row] 68 | } 69 | } 70 | 71 | } 72 | 73 | //MARK: PickerRow 74 | 75 | public class _PickerRow : Row>{ 76 | 77 | public var options = [T]() 78 | 79 | required public init(tag: String?) { 80 | super.init(tag: tag) 81 | } 82 | } 83 | 84 | /// A generic row where the user can pick an option from a picker view 85 | public final class PickerRow: _PickerRow, RowType { 86 | 87 | required public init(tag: String?) { 88 | super.init(tag: tag) 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/ActionSheetRow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ActionSheetRow.swift 3 | // Eureka 4 | // 5 | // Created by Martin Barreto on 2/23/16. 6 | // Copyright © 2016 Xmartlabs. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class AlertSelectorCell : Cell, CellType { 12 | 13 | required public init(style: UITableViewCellStyle, reuseIdentifier: String?) { 14 | super.init(style: style, reuseIdentifier: reuseIdentifier) 15 | } 16 | 17 | public override func update() { 18 | super.update() 19 | accessoryType = .None 20 | editingAccessoryType = accessoryType 21 | selectionStyle = row.isDisabled ? .None : .Default 22 | } 23 | 24 | public override func didSelect() { 25 | super.didSelect() 26 | row.deselect() 27 | } 28 | } 29 | 30 | public class _ActionSheetRow: OptionsRow, PresenterRowType { 31 | 32 | public var onPresentCallback : ((FormViewController, SelectorAlertController)->())? 33 | lazy public var presentationMode: PresentationMode>? = { 34 | return .PresentModally(controllerProvider: ControllerProvider.Callback { [weak self] in 35 | let vc = SelectorAlertController(title: self?.selectorTitle, message: nil, preferredStyle: .ActionSheet) 36 | if let popView = vc.popoverPresentationController { 37 | guard let cell = self?.cell, tableView = cell.formViewController()?.tableView else { fatalError() } 38 | popView.sourceView = tableView 39 | popView.sourceRect = tableView.convertRect(cell.detailTextLabel?.frame ?? cell.textLabel?.frame ?? cell.contentView.frame, fromView: cell) 40 | } 41 | vc.row = self 42 | return vc 43 | }, 44 | completionCallback: { [weak self] in 45 | $0.dismissViewControllerAnimated(true, completion: nil) 46 | self?.cell?.formViewController()?.tableView?.reloadData() 47 | }) 48 | }() 49 | 50 | public required init(tag: String?) { 51 | super.init(tag: tag) 52 | } 53 | 54 | public override func customDidSelect() { 55 | super.customDidSelect() 56 | if let presentationMode = presentationMode where !isDisabled { 57 | if let controller = presentationMode.createController(){ 58 | controller.row = self 59 | onPresentCallback?(cell.formViewController()!, controller) 60 | presentationMode.presentViewController(controller, row: self, presentingViewController: cell.formViewController()!) 61 | } 62 | else{ 63 | presentationMode.presentViewController(nil, row: self, presentingViewController: cell.formViewController()!) 64 | } 65 | } 66 | } 67 | } 68 | 69 | /// An options row where the user can select an option from an ActionSheet 70 | public final class ActionSheetRow: _ActionSheetRow>, RowType { 71 | required public init(tag: String?) { 72 | super.init(tag: tag) 73 | } 74 | } 75 | 76 | -------------------------------------------------------------------------------- /Example/Pods/BKMoneyKit/BKMoneyKit/BKMoneyKit.bundle/CardPatterns.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | pattern 7 | ^(36|38|30[0-5]) 8 | companyName 9 | Diners Club 10 | shortName 11 | dinersclubintl 12 | numberGrouping 13 | 4,4,4,2 14 | length 15 | 14 16 | 17 | 18 | pattern 19 | ^35 20 | companyName 21 | JCB 22 | shortName 23 | jcb 24 | numberGrouping 25 | 4,4,4,4 26 | length 27 | 16 28 | 29 | 30 | pattern 31 | ^3[47] 32 | companyName 33 | American Express 34 | shortName 35 | amex 36 | numberGrouping 37 | 4,6,5 38 | length 39 | 15 40 | 41 | 42 | pattern 43 | ^(6706|6771|6709) 44 | companyName 45 | Laser Card Services Ltd. 46 | shortName 47 | laser 48 | numberGrouping 49 | 4,4,4,4 50 | length 51 | 16,17,18,19 52 | 53 | 54 | pattern 55 | ^4 56 | companyName 57 | Visa 58 | shortName 59 | visa 60 | numberGrouping 61 | 4,4,4,4,3 62 | length 63 | 13,14,15,16,17,18,19 64 | 65 | 66 | pattern 67 | ^(62|88) 68 | companyName 69 | China UnionPay 70 | shortName 71 | unionpay 72 | numberGrouping 73 | 19 74 | length 75 | 16,17,18,19 76 | 77 | 78 | pattern 79 | ^5[1-5] 80 | companyName 81 | MasterCard 82 | shortName 83 | mastercard 84 | numberGrouping 85 | 4,4,4,4 86 | length 87 | 16 88 | 89 | 90 | pattern 91 | ^(5018|5020|5038|6304|6759|676[1-3]) 92 | companyName 93 | Maestro (MasterCard) 94 | shortName 95 | maestro 96 | numberGrouping 97 | 4,4,4,4,3 98 | length 99 | 12,13,14,15,16,17,18,19 100 | 101 | 102 | pattern 103 | ^(6011|65|64[4-9]|622) 104 | companyName 105 | Discover 106 | shortName 107 | discover 108 | numberGrouping 109 | 4,4,4,4 110 | length 111 | 16 112 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/SwiftSupport.swift: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | public extension FBSnapshotTestCase { 12 | public func FBSnapshotVerifyView(view: UIView, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), tolerance: CGFloat = 0, file: StaticString = #file, line: UInt = #line) { 13 | FBSnapshotVerifyViewOrLayer(view, identifier: identifier, suffixes: suffixes, tolerance: tolerance, file: file, line: line) 14 | } 15 | 16 | public func FBSnapshotVerifyLayer(layer: CALayer, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), tolerance: CGFloat = 0, file: StaticString = #file, line: UInt = #line) { 17 | FBSnapshotVerifyViewOrLayer(layer, identifier: identifier, suffixes: suffixes, tolerance: tolerance, file: file, line: line) 18 | } 19 | 20 | private func FBSnapshotVerifyViewOrLayer(viewOrLayer: AnyObject, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), tolerance: CGFloat = 0, file: StaticString = #file, line: UInt = #line) { 21 | let envReferenceImageDirectory = self.getReferenceImageDirectoryWithDefault(FB_REFERENCE_IMAGE_DIR) 22 | var error: NSError? 23 | var comparisonSuccess = false 24 | 25 | if let envReferenceImageDirectory = envReferenceImageDirectory { 26 | for suffix in suffixes { 27 | let referenceImagesDirectory = "\(envReferenceImageDirectory)\(suffix)" 28 | if viewOrLayer.isKindOfClass(UIView) { 29 | do { 30 | try compareSnapshotOfView(viewOrLayer as! UIView, referenceImagesDirectory: referenceImagesDirectory, identifier: identifier, tolerance: tolerance) 31 | comparisonSuccess = true 32 | } catch let error1 as NSError { 33 | error = error1 34 | comparisonSuccess = false 35 | } 36 | } else if viewOrLayer.isKindOfClass(CALayer) { 37 | do { 38 | try compareSnapshotOfLayer(viewOrLayer as! CALayer, referenceImagesDirectory: referenceImagesDirectory, identifier: identifier, tolerance: tolerance) 39 | comparisonSuccess = true 40 | } catch let error1 as NSError { 41 | error = error1 42 | comparisonSuccess = false 43 | } 44 | } else { 45 | assertionFailure("Only UIView and CALayer classes can be snapshotted") 46 | } 47 | 48 | assert(recordMode == false, message: "Test ran in record mode. Reference image is now saved. Disable record mode to perform an actual snapshot comparison!", file: file, line: line) 49 | 50 | if comparisonSuccess || recordMode { 51 | break 52 | } 53 | 54 | assert(comparisonSuccess, message: "Snapshot comparison failed: \(error)", file: file, line: line) 55 | } 56 | } else { 57 | XCTFail("Missing value for referenceImagesDirectory - Set FB_REFERENCE_IMAGE_DIR as Environment variable in your scheme.") 58 | } 59 | } 60 | 61 | func assert(assertion: Bool, message: String, file: StaticString, line: UInt) { 62 | if !assertion { 63 | XCTFail(message, file: file, line: line) 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Example/Pods/BKMoneyKit/BKMoneyKit/BKCardNumberLabel.m: -------------------------------------------------------------------------------- 1 | // 2 | // BKCardNumberLabel.m 3 | // BKMoneyKitDemo 4 | // 5 | // Created by Byungkook Jang on 2014. 9. 21.. 6 | // Copyright (c) 2014년 Byungkook Jang. All rights reserved. 7 | // 8 | 9 | #import "BKCardNumberLabel.h" 10 | #import "BKMoneyUtils.h" 11 | 12 | @interface BKCardNumberLabel () 13 | 14 | @property (nonatomic, strong) BKCardNumberFormatter *cardNumberFormatter; 15 | @property (nonatomic, strong) UIImageView *cardLogoImageView; 16 | 17 | @end 18 | 19 | @implementation BKCardNumberLabel 20 | 21 | - (instancetype)initWithFrame:(CGRect)frame 22 | { 23 | self = [super initWithFrame:frame]; 24 | if (self) { 25 | [self commonInit]; 26 | } 27 | return self; 28 | } 29 | 30 | - (id)initWithCoder:(NSCoder *)aDecoder 31 | { 32 | self = [super initWithCoder:aDecoder]; 33 | if (self) { 34 | [self commonInit]; 35 | } 36 | return self; 37 | } 38 | 39 | - (void)commonInit 40 | { 41 | _cardNumberFormatter = [[BKCardNumberFormatter alloc] init]; 42 | self.showsCardLogo = YES; 43 | } 44 | 45 | #pragma mark - UIView 46 | 47 | - (CGSize)sizeThatFits:(CGSize)size 48 | { 49 | CGSize result = [super sizeThatFits:size]; 50 | 51 | if (self.showsCardLogo) { 52 | result.width += CGRectGetWidth(self.cardLogoImageView.frame); 53 | } 54 | 55 | return result; 56 | } 57 | 58 | #pragma mark - UILabel 59 | 60 | - (void)drawTextInRect:(CGRect)rect 61 | { 62 | if (self.showsCardLogo) { 63 | rect = CGRectOffset(rect, CGRectGetWidth(self.cardLogoImageView.frame), 0); 64 | [super drawTextInRect:rect]; 65 | } else { 66 | [super drawTextInRect:rect]; 67 | } 68 | } 69 | 70 | #pragma mark - Public Methods 71 | 72 | - (void)setShowsCardLogo:(BOOL)showsCardLogo 73 | { 74 | if (_showsCardLogo != showsCardLogo) { 75 | 76 | [_cardLogoImageView removeFromSuperview]; 77 | 78 | _showsCardLogo = showsCardLogo; 79 | 80 | if (showsCardLogo) { 81 | 82 | UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 44.f, CGRectGetHeight(self.frame))]; 83 | imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight; 84 | imageView.contentMode = UIViewContentModeCenter; 85 | [self addSubview:imageView]; 86 | 87 | self.cardLogoImageView = imageView; 88 | 89 | [self updateCardLogoImage]; 90 | } 91 | } 92 | } 93 | 94 | - (void)updateCardLogoImage 95 | { 96 | if (nil == self.cardLogoImageView) { 97 | return; 98 | } 99 | 100 | BKCardPatternInfo *patternInfo = self.cardNumberFormatter.cardPatternInfo; 101 | 102 | UIImage *cardLogoImage = [BKMoneyUtils cardLogoImageWithShortName:patternInfo.shortName]; 103 | 104 | self.cardLogoImageView.image = cardLogoImage; 105 | } 106 | 107 | - (void)setCardNumber:(NSString *)cardNumber 108 | { 109 | self.text = [self.cardNumberFormatter formattedStringFromRawString:cardNumber]; 110 | [self updateCardLogoImage]; 111 | } 112 | 113 | - (NSString *)cardNumber 114 | { 115 | return [self.cardNumberFormatter rawStringFromFormattedString:self.text]; 116 | } 117 | 118 | - (NSString *)cardCompanyName 119 | { 120 | return self.cardNumberFormatter.cardPatternInfo.companyName; 121 | } 122 | 123 | @end 124 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Core/NavigationAccessoryView.swift: -------------------------------------------------------------------------------- 1 | // NavigationAccessoryView.swift 2 | // Eureka ( https://github.com/xmartlabs/Eureka ) 3 | // 4 | // Copyright (c) 2016 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 Foundation 27 | 28 | /// Class for the navigation accessory view used in FormViewController 29 | public class NavigationAccessoryView : UIToolbar { 30 | 31 | public var previousButton: UIBarButtonItem! 32 | public var nextButton: UIBarButtonItem! 33 | public var doneButton = UIBarButtonItem(barButtonSystemItem: .Done, target: nil, action: nil) 34 | private var fixedSpace = UIBarButtonItem(barButtonSystemItem: .FixedSpace, target: nil, action: nil) 35 | private var flexibleSpace = UIBarButtonItem(barButtonSystemItem: .FlexibleSpace, target: nil, action: nil) 36 | 37 | public override init(frame: CGRect) { 38 | super.init(frame: CGRectMake(0, 0, frame.size.width, 44.0)) 39 | autoresizingMask = .FlexibleWidth 40 | fixedSpace.width = 22.0 41 | initializeChevrons() 42 | setItems([previousButton, fixedSpace, nextButton, flexibleSpace, doneButton], animated: false) 43 | } 44 | 45 | required public init?(coder aDecoder: NSCoder) { 46 | super.init(coder: aDecoder) 47 | } 48 | 49 | private func initializeChevrons() { 50 | var bundle = NSBundle(forClass: self.classForCoder) 51 | if let resourcePath = bundle.pathForResource("Eureka", ofType: "bundle") { 52 | if let resourcesBundle = NSBundle(path: resourcePath) { 53 | bundle = resourcesBundle 54 | } 55 | } 56 | 57 | var imageLeftChevron = UIImage(named: "back-chevron", inBundle: bundle, compatibleWithTraitCollection: nil) 58 | var imageRightChevron = UIImage(named: "forward-chevron", inBundle: bundle, compatibleWithTraitCollection: nil) 59 | // RTL language support 60 | if #available(iOS 9.0, *) { 61 | imageLeftChevron = imageLeftChevron?.imageFlippedForRightToLeftLayoutDirection() 62 | imageRightChevron = imageRightChevron?.imageFlippedForRightToLeftLayoutDirection() 63 | } 64 | 65 | previousButton = UIBarButtonItem(image: imageLeftChevron, style: .Plain, target: nil, action: nil) 66 | nextButton = UIBarButtonItem(image: imageRightChevron, style: .Plain, target: nil, action: nil) 67 | } 68 | 69 | public override func touchesBegan(touches: Set, withEvent event: UIEvent?) {} 70 | } -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-BasePods-EurekaCreditCard_Example/Pods-BasePods-EurekaCreditCard_Example-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## BKMoneyKit 5 | 6 | The MIT License (MIT) 7 | 8 | Copyright (c) 2014 Byungkook Jang 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 | ## Eureka 30 | 31 | The MIT License (MIT) 32 | 33 | Copyright (c) 2015 XMARTLABS 34 | 35 | Permission is hereby granted, free of charge, to any person obtaining a copy 36 | of this software and associated documentation files (the "Software"), to deal 37 | in the Software without restriction, including without limitation the rights 38 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 39 | copies of the Software, and to permit persons to whom the Software is 40 | furnished to do so, 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, 47 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 48 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 49 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 50 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 51 | SOFTWARE. 52 | 53 | 54 | 55 | ## EurekaCreditCard 56 | 57 | The MIT License (MIT) 58 | 59 | Copyright (c) 2016 Demetrio Filocamo 60 | 61 | Permission is hereby granted, free of charge, to any person obtaining a copy 62 | of this software and associated documentation files (the "Software"), to deal 63 | in the Software without restriction, including without limitation the rights 64 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 65 | copies of the Software, and to permit persons to whom the Software is 66 | furnished to do so, subject to the following conditions: 67 | 68 | The above copyright notice and this permission notice shall be included in all 69 | copies or substantial portions of the Software. 70 | 71 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 72 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 73 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 74 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 75 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 76 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 77 | SOFTWARE. 78 | 79 | Generated by CocoaPods - https://cocoapods.org 80 | -------------------------------------------------------------------------------- /Example/EurekaCreditCard/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/ButtonRow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ButtonRow.swift 3 | // Eureka 4 | // 5 | // Created by Martin Barreto on 2/23/16. 6 | // Copyright © 2016 Xmartlabs. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | // MARK: ButtonCell 12 | 13 | public class ButtonCellOf: Cell, CellType { 14 | 15 | required public init(style: UITableViewCellStyle, reuseIdentifier: String?) { 16 | super.init(style: style, reuseIdentifier: reuseIdentifier) 17 | } 18 | 19 | public override func update() { 20 | super.update() 21 | selectionStyle = row.isDisabled ? .None : .Default 22 | accessoryType = .None 23 | editingAccessoryType = accessoryType 24 | textLabel?.textAlignment = .Center 25 | textLabel?.textColor = tintColor 26 | var red: CGFloat = 0, green: CGFloat = 0, blue: CGFloat = 0, alpha: CGFloat = 0 27 | tintColor.getRed(&red, green: &green, blue: &blue, alpha: &alpha) 28 | textLabel?.textColor = UIColor(red: red, green: green, blue: blue, alpha: row.isDisabled ? 0.3 : 1.0) 29 | } 30 | 31 | public override func didSelect() { 32 | super.didSelect() 33 | row.deselect() 34 | } 35 | } 36 | 37 | public typealias ButtonCell = ButtonCellOf 38 | 39 | 40 | //MARK: ButtonRow 41 | 42 | public class _ButtonRowOf : Row> { 43 | public var presentationMode: PresentationMode? 44 | 45 | required public init(tag: String?) { 46 | super.init(tag: tag) 47 | displayValueFor = nil 48 | cellStyle = .Default 49 | } 50 | 51 | public override func customDidSelect() { 52 | super.customDidSelect() 53 | if !isDisabled { 54 | if let presentationMode = presentationMode { 55 | if let controller = presentationMode.createController(){ 56 | presentationMode.presentViewController(controller, row: self, presentingViewController: self.cell.formViewController()!) 57 | } 58 | else{ 59 | presentationMode.presentViewController(nil, row: self, presentingViewController: self.cell.formViewController()!) 60 | } 61 | } 62 | } 63 | } 64 | 65 | public override func customUpdateCell() { 66 | super.customUpdateCell() 67 | let leftAligmnment = presentationMode != nil 68 | cell.textLabel?.textAlignment = leftAligmnment ? .Left : .Center 69 | cell.accessoryType = !leftAligmnment || isDisabled ? .None : .DisclosureIndicator 70 | cell.editingAccessoryType = cell.accessoryType 71 | if (!leftAligmnment){ 72 | var red: CGFloat = 0, green: CGFloat = 0, blue: CGFloat = 0, alpha: CGFloat = 0 73 | cell.tintColor.getRed(&red, green: &green, blue: &blue, alpha: &alpha) 74 | cell.textLabel?.textColor = UIColor(red: red, green: green, blue: blue, alpha:isDisabled ? 0.3 : 1.0) 75 | } 76 | else{ 77 | cell.textLabel?.textColor = nil 78 | } 79 | } 80 | 81 | public override func prepareForSegue(segue: UIStoryboardSegue) { 82 | super.prepareForSegue(segue) 83 | let rowVC = segue.destinationViewController as? RowControllerType 84 | rowVC?.completionCallback = self.presentationMode?.completionHandler 85 | } 86 | } 87 | 88 | /// A generic row with a button. The action of this button can be anything but normally will push a new view controller 89 | public final class ButtonRowOf : _ButtonRowOf, RowType { 90 | public required init(tag: String?) { 91 | super.init(tag: tag) 92 | } 93 | } 94 | 95 | /// A row with a button and String value. The action of this button can be anything but normally will push a new view controller 96 | public typealias ButtonRow = ButtonRowOf 97 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/Common/DateFieldRow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DateFieldRow.swift 3 | // Eureka 4 | // 5 | // Created by Martin Barreto on 2/24/16. 6 | // Copyright © 2016 Xmartlabs. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public protocol DatePickerRowProtocol: class { 12 | var minimumDate : NSDate? { get set } 13 | var maximumDate : NSDate? { get set } 14 | var minuteInterval : Int? { get set } 15 | } 16 | 17 | 18 | public class DateCell : Cell, CellType { 19 | 20 | lazy public var datePicker = UIDatePicker() 21 | 22 | public required init(style: UITableViewCellStyle, reuseIdentifier: String?) { 23 | super.init(style: style, reuseIdentifier: reuseIdentifier) 24 | } 25 | 26 | public override func setup() { 27 | super.setup() 28 | accessoryType = .None 29 | editingAccessoryType = .None 30 | datePicker.datePickerMode = datePickerMode() 31 | datePicker.addTarget(self, action: #selector(DateCell.datePickerValueChanged(_:)), forControlEvents: .ValueChanged) 32 | } 33 | 34 | deinit { 35 | datePicker.removeTarget(self, action: nil, forControlEvents: .AllEvents) 36 | } 37 | 38 | public override func update() { 39 | super.update() 40 | selectionStyle = row.isDisabled ? .None : .Default 41 | datePicker.setDate(row.value ?? NSDate(), animated: row is CountDownPickerRow) 42 | datePicker.minimumDate = (row as? DatePickerRowProtocol)?.minimumDate 43 | datePicker.maximumDate = (row as? DatePickerRowProtocol)?.maximumDate 44 | if let minuteIntervalValue = (row as? DatePickerRowProtocol)?.minuteInterval{ 45 | datePicker.minuteInterval = minuteIntervalValue 46 | } 47 | } 48 | 49 | public override func didSelect() { 50 | super.didSelect() 51 | row.deselect() 52 | } 53 | 54 | override public var inputView : UIView? { 55 | if let v = row.value{ 56 | datePicker.setDate(v, animated:row is CountDownRow) 57 | } 58 | return datePicker 59 | } 60 | 61 | func datePickerValueChanged(sender: UIDatePicker){ 62 | row.value = sender.date 63 | detailTextLabel?.text = row.displayValueFor?(row.value) 64 | } 65 | 66 | private func datePickerMode() -> UIDatePickerMode{ 67 | switch row { 68 | case is DateRow: 69 | return .Date 70 | case is TimeRow: 71 | return .Time 72 | case is DateTimeRow: 73 | return .DateAndTime 74 | case is CountDownRow: 75 | return .CountDownTimer 76 | default: 77 | return .Date 78 | } 79 | } 80 | 81 | public override func cellCanBecomeFirstResponder() -> Bool { 82 | return canBecomeFirstResponder() 83 | } 84 | 85 | public override func canBecomeFirstResponder() -> Bool { 86 | return !row.isDisabled; 87 | } 88 | } 89 | 90 | 91 | public class _DateFieldRow: Row, DatePickerRowProtocol, NoValueDisplayTextConformance { 92 | 93 | /// The minimum value for this row's UIDatePicker 94 | public var minimumDate : NSDate? 95 | 96 | /// The maximum value for this row's UIDatePicker 97 | public var maximumDate : NSDate? 98 | 99 | /// The interval between options for this row's UIDatePicker 100 | public var minuteInterval : Int? 101 | 102 | /// The formatter for the date picked by the user 103 | public var dateFormatter: NSDateFormatter? 104 | 105 | public var noValueDisplayText: String? = nil 106 | 107 | required public init(tag: String?) { 108 | super.init(tag: tag) 109 | displayValueFor = { [unowned self] value in 110 | guard let val = value, let formatter = self.dateFormatter else { return nil } 111 | return formatter.stringFromDate(val) 112 | } 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/ButtonRowWithPresent.swift: -------------------------------------------------------------------------------- 1 | // Rows.swift 2 | // Eureka ( https://github.com/xmartlabs/Eureka ) 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 | import Foundation 26 | 27 | public class _ButtonRowWithPresent: Row>, PresenterRowType { 28 | 29 | public var presentationMode: PresentationMode? 30 | public var onPresentCallback : ((FormViewController, VCType)->())? 31 | 32 | required public init(tag: String?) { 33 | super.init(tag: tag) 34 | displayValueFor = nil 35 | cellStyle = .Default 36 | } 37 | 38 | public override func customUpdateCell() { 39 | super.customUpdateCell() 40 | let leftAligmnment = presentationMode != nil 41 | cell.textLabel?.textAlignment = leftAligmnment ? .Left : .Center 42 | cell.accessoryType = !leftAligmnment || isDisabled ? .None : .DisclosureIndicator 43 | cell.editingAccessoryType = cell.accessoryType 44 | if (!leftAligmnment){ 45 | var red: CGFloat = 0, green: CGFloat = 0, blue: CGFloat = 0, alpha: CGFloat = 0 46 | cell.tintColor.getRed(&red, green: &green, blue: &blue, alpha: &alpha) 47 | cell.textLabel?.textColor = UIColor(red: red, green: green, blue: blue, alpha:isDisabled ? 0.3 : 1.0) 48 | } 49 | else{ 50 | cell.textLabel?.textColor = nil 51 | } 52 | } 53 | 54 | public override func customDidSelect() { 55 | super.customDidSelect() 56 | if let presentationMode = presentationMode where !isDisabled { 57 | if let controller = presentationMode.createController(){ 58 | controller.row = self 59 | onPresentCallback?(cell.formViewController()!, controller) 60 | presentationMode.presentViewController(controller, row: self, presentingViewController: cell.formViewController()!) 61 | } 62 | else{ 63 | presentationMode.presentViewController(nil, row: self, presentingViewController: cell.formViewController()!) 64 | } 65 | } 66 | } 67 | 68 | public override func prepareForSegue(segue: UIStoryboardSegue) { 69 | super.prepareForSegue(segue) 70 | guard let rowVC = segue.destinationViewController as? VCType else { 71 | return 72 | } 73 | if let callback = self.presentationMode?.completionHandler{ 74 | rowVC.completionCallback = callback 75 | } 76 | rowVC.row = self 77 | onPresentCallback?(cell.formViewController()!, rowVC) 78 | } 79 | 80 | } 81 | 82 | 83 | //MARK: Rows 84 | 85 | /// A generic row with a button that presents a view controller when tapped 86 | public final class ButtonRowWithPresent : _ButtonRowWithPresent, RowType { 87 | public required init(tag: String?) { 88 | super.init(tag: tag) 89 | } 90 | } 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/DatePickerRow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DateRow.swift 3 | // Eureka 4 | // 5 | // Created by Martin Barreto on 2/24/16. 6 | // Copyright © 2016 Xmartlabs. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class DatePickerCell : Cell, CellType { 12 | 13 | public lazy var datePicker: UIDatePicker = { [unowned self] in 14 | let picker = UIDatePicker() 15 | picker.translatesAutoresizingMaskIntoConstraints = false 16 | self.contentView.addSubview(picker) 17 | self.contentView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|-0-[picker]-0-|", options: [], metrics: nil, views: ["picker": picker])) 18 | self.contentView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|-0-[picker]-0-|", options: [], metrics: nil, views: ["picker": picker])) 19 | picker.addTarget(self, action: #selector(DatePickerCell.datePickerValueChanged(_:)), forControlEvents: .ValueChanged) 20 | return picker 21 | }() 22 | 23 | public required init(style: UITableViewCellStyle, reuseIdentifier: String?){ 24 | super.init(style: style, reuseIdentifier: reuseIdentifier) 25 | } 26 | 27 | public override func setup() { 28 | super.setup() 29 | accessoryType = .None 30 | editingAccessoryType = .None 31 | datePicker.datePickerMode = datePickerMode() 32 | } 33 | 34 | deinit { 35 | datePicker.removeTarget(self, action: nil, forControlEvents: .AllEvents) 36 | } 37 | 38 | public override func update() { 39 | super.update() 40 | selectionStyle = row.isDisabled ? .None : .Default 41 | datePicker.userInteractionEnabled = !row.isDisabled 42 | detailTextLabel?.text = nil 43 | textLabel?.text = nil 44 | datePicker.setDate(row.value ?? NSDate(), animated: row is CountDownPickerRow) 45 | datePicker.minimumDate = (row as? DatePickerRowProtocol)?.minimumDate 46 | datePicker.maximumDate = (row as? DatePickerRowProtocol)?.maximumDate 47 | if let minuteIntervalValue = (row as? DatePickerRowProtocol)?.minuteInterval{ 48 | datePicker.minuteInterval = minuteIntervalValue 49 | } 50 | } 51 | 52 | func datePickerValueChanged(sender: UIDatePicker){ 53 | row?.value = sender.date 54 | } 55 | 56 | private func datePickerMode() -> UIDatePickerMode{ 57 | switch row { 58 | case is DatePickerRow: 59 | return .Date 60 | case is TimePickerRow: 61 | return .Time 62 | case is DateTimePickerRow: 63 | return .DateAndTime 64 | case is CountDownPickerRow: 65 | return .CountDownTimer 66 | default: 67 | return .Date 68 | } 69 | } 70 | } 71 | 72 | public class _DatePickerRow : Row, DatePickerRowProtocol { 73 | 74 | public var minimumDate : NSDate? 75 | public var maximumDate : NSDate? 76 | public var minuteInterval : Int? 77 | 78 | required public init(tag: String?) { 79 | super.init(tag: tag) 80 | displayValueFor = nil 81 | } 82 | } 83 | 84 | /// A row with an NSDate as value where the user can select a date directly. 85 | public final class DatePickerRow : _DatePickerRow, RowType { 86 | public required init(tag: String?) { 87 | super.init(tag: tag) 88 | } 89 | } 90 | 91 | /// A row with an NSDate as value where the user can select a time directly. 92 | public final class TimePickerRow : _DatePickerRow, RowType { 93 | public required init(tag: String?) { 94 | super.init(tag: tag) 95 | } 96 | } 97 | 98 | /// A row with an NSDate as value where the user can select date and time directly. 99 | public final class DateTimePickerRow : _DatePickerRow, RowType { 100 | public required init(tag: String?) { 101 | super.init(tag: tag) 102 | } 103 | } 104 | 105 | /// A row with an NSDate as value where the user can select hour and minute as a countdown timer. 106 | public final class CountDownPickerRow : _DatePickerRow, RowType { 107 | public required init(tag: String?) { 108 | super.init(tag: tag) 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /Example/Pods/FBSnapshotTestCase/README.md: -------------------------------------------------------------------------------- 1 | FBSnapshotTestCase 2 | ====================== 3 | 4 | [![Build Status](https://travis-ci.org/facebook/ios-snapshot-test-case.svg)](https://travis-ci.org/facebook/ios-snapshot-test-case) [![Cocoa Pod Version](https://cocoapod-badges.herokuapp.com/v/FBSnapshotTestCase/badge.svg)](http://cocoadocs.org/docsets/FBSnapshotTestCase/) 5 | 6 | What it does 7 | ------------ 8 | 9 | A "snapshot test case" takes a configured `UIView` or `CALayer` and uses the 10 | `renderInContext:` method to get an image snapshot of its contents. It 11 | compares this snapshot to a "reference image" stored in your source code 12 | repository and fails the test if the two images don't match. 13 | 14 | Why? 15 | ---- 16 | 17 | At Facebook we write a lot of UI code. As you might imagine, each type of 18 | feed story is rendered using a subclass of `UIView`. There are a lot of edge 19 | cases that we want to handle correctly: 20 | 21 | - What if there is more text than can fit in the space available? 22 | - What if an image doesn't match the size of an image view? 23 | - What should the highlighted state look like? 24 | 25 | It's straightforward to test logic code, but less obvious how you should test 26 | views. You can do a lot of rectangle asserts, but these are hard to understand 27 | or visualize. Looking at an image diff shows you exactly what changed and how 28 | it will look to users. 29 | 30 | We developed `FBSnapshotTestCase` to make snapshot tests easy. 31 | 32 | Installation with CocoaPods 33 | --------------------------- 34 | 35 | 1. Add the following lines to your Podfile: 36 | 37 | ``` 38 | target "Tests" do 39 | pod 'FBSnapshotTestCase' 40 | end 41 | ``` 42 | 43 | If you support iOS 7 use `FBSnapshotTestCase/Core` instead, which doesn't contain Swift support. 44 | 45 | Replace "Tests" with the name of your test project. 46 | 47 | 2. There are [three ways](https://github.com/facebook/ios-snapshot-test-case/blob/master/FBSnapshotTestCase/FBSnapshotTestCase.h#L19-L29) of setting reference image directories, the recommended one is to define `FB_REFERENCE_IMAGE_DIR` in your scheme. This should point to the directory where you want reference images to be stored. At Facebook, we normally use this: 48 | 49 | |Name|Value| 50 | |:---|:----| 51 | |`FB_REFERENCE_IMAGE_DIR`|`$(SOURCE_ROOT)/$(PROJECT_NAME)Tests/ReferenceImages`| 52 | 53 | 54 | ![](FBSnapshotTestCaseDemo/Scheme_FB_REFERENCE_IMAGE_DIR.png) 55 | 56 | Creating a snapshot test 57 | ------------------------ 58 | 59 | 1. Subclass `FBSnapshotTestCase` instead of `XCTestCase`. 60 | 2. From within your test, use `FBSnapshotVerifyView`. 61 | 3. Run the test once with `self.recordMode = YES;` in the test's `-setUp` 62 | method. (This creates the reference images on disk.) 63 | 4. Remove the line enabling record mode and run the test. 64 | 65 | Features 66 | -------- 67 | 68 | - Automatically names reference images on disk according to test class and 69 | selector. 70 | - Prints a descriptive error message to the console on failure. (Bonus: 71 | failure message includes a one-line command to see an image diff if 72 | you have [Kaleidoscope](http://www.kaleidoscopeapp.com) installed.) 73 | - Supply an optional "identifier" if you want to perform multiple snapshots 74 | in a single test method. 75 | - Support for `CALayer` via `FBSnapshotVerifyLayer`. 76 | - `usesDrawViewHierarchyInRect` to handle cases like `UIVisualEffect`, `UIAppearance` and Size Classes. 77 | - `isDeviceAgnostic` to allow appending the device model (`iPhone`, `iPad`, `iPod Touch`, etc), OS version and screen size to the images (allowing to have multiple tests for the same «snapshot» for different `OS`s and devices). 78 | 79 | Notes 80 | ----- 81 | 82 | Your unit test must be an "application test", not a "logic test." (That is, it 83 | must be run within the Simulator so that it has access to UIKit.) In Xcode 5 84 | and later new projects only offer application tests, but older projects will 85 | have separate targets for the two types. 86 | 87 | Authors 88 | ------- 89 | 90 | `FBSnapshotTestCase` was written at Facebook by 91 | [Jonathan Dann](https://facebook.com/j.p.dann) with significant contributions by 92 | [Todd Krabach](https://facebook.com/toddkrabach). 93 | 94 | License 95 | ------- 96 | 97 | `FBSnapshotTestCase` is BSD-licensed. See `LICENSE`. 98 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-BasePods-EurekaCreditCard_Example/Pods-BasePods-EurekaCreditCard_Example-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | 86 | if [[ "$CONFIGURATION" == "Debug" ]]; then 87 | install_framework "$BUILT_PRODUCTS_DIR/BKMoneyKit/BKMoneyKit.framework" 88 | install_framework "$BUILT_PRODUCTS_DIR/Eureka/Eureka.framework" 89 | install_framework "$BUILT_PRODUCTS_DIR/EurekaCreditCard/EurekaCreditCard.framework" 90 | fi 91 | if [[ "$CONFIGURATION" == "Release" ]]; then 92 | install_framework "$BUILT_PRODUCTS_DIR/BKMoneyKit/BKMoneyKit.framework" 93 | install_framework "$BUILT_PRODUCTS_DIR/Eureka/Eureka.framework" 94 | install_framework "$BUILT_PRODUCTS_DIR/EurekaCreditCard/EurekaCreditCard.framework" 95 | fi 96 | -------------------------------------------------------------------------------- /Example/Pods/BKMoneyKit/BKMoneyKit/BKCardNumberFormatter.m: -------------------------------------------------------------------------------- 1 | // 2 | // BKCardNumberFormatter.m 3 | // BKMoneyKit 4 | // 5 | // Created by Byungkook Jang on 2014. 8. 23.. 6 | // Copyright (c) 2014년 Byungkook Jang. All rights reserved. 7 | // 8 | 9 | #import "BKCardNumberFormatter.h" 10 | #import "BKCardPatternInfo.h" 11 | #import "BKMoneyUtils.h" 12 | 13 | @interface BKCardNumberFormatter () 14 | 15 | @property (nonatomic, strong) NSSet *cardPatterns; 16 | @property (nonatomic, strong) NSRegularExpression *nonNumericRegularExpression; 17 | 18 | @property (nonatomic, strong) NSString *cachedPrefix; 19 | @property (nonatomic, strong) BKCardPatternInfo *cardPatternInfo; 20 | 21 | @end 22 | 23 | @implementation BKCardNumberFormatter 24 | 25 | - (instancetype)init 26 | { 27 | self = [super init]; 28 | if (self) { 29 | 30 | NSString *filePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"BKMoneyKit.bundle/CardPatterns" ofType:@"plist"]; 31 | NSArray *array = [NSArray arrayWithContentsOfFile:filePath]; 32 | NSMutableArray *mutableArray = [NSMutableArray arrayWithCapacity:array.count]; 33 | 34 | for (NSDictionary *dictionary in array) { 35 | 36 | BKCardPatternInfo *pattern = [[BKCardPatternInfo alloc] initWithDictionary:dictionary]; 37 | if (pattern) { 38 | [mutableArray addObject:pattern]; 39 | } 40 | } 41 | 42 | self.cardPatterns = [NSSet setWithArray:mutableArray]; 43 | self.nonNumericRegularExpression = [BKMoneyUtils nonNumericRegularExpression]; 44 | self.groupSeparater = @" "; 45 | } 46 | return self; 47 | } 48 | 49 | - (NSString *)stringForObjectValue:(id)obj 50 | { 51 | if (NO == [obj isKindOfClass:[NSString class]]) { 52 | return nil; 53 | } 54 | 55 | NSString *numberString = [self.nonNumericRegularExpression stringByReplacingMatchesInString:obj 56 | options:0 57 | range:NSMakeRange(0, [obj length]) 58 | withTemplate:@""]; 59 | 60 | BKCardPatternInfo *patternInfo = [self cardPatternInfoWithNumberString:numberString]; 61 | 62 | if (patternInfo) { 63 | return [patternInfo groupedStringWithString:numberString groupSeparater:self.groupSeparater maskingCharacter:self.maskingCharacter maskingGroupIndexSet:self.maskingGroupIndexSet]; 64 | } else { 65 | return numberString; 66 | } 67 | } 68 | 69 | - (BOOL)getObjectValue:(out __autoreleasing id *)obj forString:(NSString *)string errorDescription:(out NSString *__autoreleasing *)error 70 | { 71 | if (obj) { 72 | *obj = [self.nonNumericRegularExpression stringByReplacingMatchesInString:string options:0 range:NSMakeRange(0, string.length) withTemplate:@""]; 73 | } 74 | 75 | return YES; 76 | } 77 | 78 | - (NSString *)formattedStringFromRawString:(NSString *)rawString 79 | { 80 | return [self stringForObjectValue:rawString]; 81 | } 82 | 83 | - (NSString *)rawStringFromFormattedString:(NSString *)string 84 | { 85 | NSString *result = nil; 86 | NSString *errorDescription = nil; 87 | if ([self getObjectValue:&result forString:string errorDescription:&errorDescription]) { 88 | return result; 89 | } else { 90 | return nil; 91 | } 92 | } 93 | 94 | - (BKCardPatternInfo *)cardPatternInfoWithNumberString:(NSString *)aNumberString 95 | { 96 | if (self.cachedPrefix && [aNumberString hasPrefix:self.cachedPrefix] && self.cardPatternInfo) { 97 | return self.cardPatternInfo; 98 | } 99 | 100 | for (BKCardPatternInfo *patternInfo in self.cardPatterns) { 101 | 102 | if ([patternInfo patternMatchesWithNumberString:aNumberString]) { 103 | 104 | self.cardPatternInfo = patternInfo; 105 | self.cachedPrefix = aNumberString; 106 | 107 | return patternInfo; 108 | } 109 | } 110 | 111 | self.cachedPrefix = nil; 112 | self.cardPatternInfo = nil; 113 | 114 | return nil; 115 | } 116 | 117 | @end 118 | -------------------------------------------------------------------------------- /Example/Pods/Eureka/Source/Rows/DateRow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DateRow.swift 3 | // Eureka 4 | // 5 | // Created by Martin Barreto on 2/24/16. 6 | // Copyright © 2016 Xmartlabs. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class _DateRow: _DateFieldRow { 12 | required public init(tag: String?) { 13 | super.init(tag: tag) 14 | dateFormatter = NSDateFormatter() 15 | dateFormatter?.timeStyle = .NoStyle 16 | dateFormatter?.dateStyle = .MediumStyle 17 | dateFormatter?.locale = NSLocale.currentLocale() 18 | } 19 | } 20 | 21 | 22 | public class _TimeRow: _DateFieldRow { 23 | required public init(tag: String?) { 24 | super.init(tag: tag) 25 | dateFormatter = NSDateFormatter() 26 | dateFormatter?.timeStyle = .ShortStyle 27 | dateFormatter?.dateStyle = .NoStyle 28 | dateFormatter?.locale = NSLocale.currentLocale() 29 | } 30 | } 31 | 32 | public class _DateTimeRow: _DateFieldRow { 33 | required public init(tag: String?) { 34 | super.init(tag: tag) 35 | dateFormatter = NSDateFormatter() 36 | dateFormatter?.timeStyle = .ShortStyle 37 | dateFormatter?.dateStyle = .ShortStyle 38 | dateFormatter?.locale = NSLocale.currentLocale() 39 | } 40 | } 41 | 42 | public class _CountDownRow: _DateFieldRow { 43 | required public init(tag: String?) { 44 | super.init(tag: tag) 45 | displayValueFor = { [unowned self] value in 46 | guard let val = value else { 47 | return nil 48 | } 49 | if let formatter = self.dateFormatter { 50 | return formatter.stringFromDate(val) 51 | } 52 | let components = NSCalendar.currentCalendar().components(NSCalendarUnit.Minute.union(NSCalendarUnit.Hour), fromDate: val) 53 | var hourString = "hour" 54 | if components.hour != 1{ 55 | hourString += "s" 56 | } 57 | return "\(components.hour) \(hourString) \(components.minute) min" 58 | } 59 | } 60 | } 61 | 62 | /// A row with an NSDate as value where the user can select a date from a picker view. 63 | public final class DateRow: _DateRow, RowType { 64 | required public init(tag: String?) { 65 | super.init(tag: tag) 66 | onCellHighlight { cell, row in 67 | let color = cell.detailTextLabel?.textColor 68 | row.onCellUnHighlight { cell, _ in 69 | cell.detailTextLabel?.textColor = color 70 | } 71 | cell.detailTextLabel?.textColor = cell.tintColor 72 | } 73 | } 74 | } 75 | 76 | 77 | /// A row with an NSDate as value where the user can select a time from a picker view. 78 | public final class TimeRow: _TimeRow, RowType { 79 | required public init(tag: String?) { 80 | super.init(tag: tag) 81 | onCellHighlight { cell, row in 82 | let color = cell.detailTextLabel?.textColor 83 | row.onCellUnHighlight { cell, _ in 84 | cell.detailTextLabel?.textColor = color 85 | } 86 | cell.detailTextLabel?.textColor = cell.tintColor 87 | } 88 | } 89 | } 90 | 91 | /// A row with an NSDate as value where the user can select date and time from a picker view. 92 | public final class DateTimeRow: _DateTimeRow, RowType { 93 | required public init(tag: String?) { 94 | super.init(tag: tag) 95 | onCellHighlight { cell, row in 96 | let color = cell.detailTextLabel?.textColor 97 | row.onCellUnHighlight { cell, _ in 98 | cell.detailTextLabel?.textColor = color 99 | } 100 | cell.detailTextLabel?.textColor = cell.tintColor 101 | } 102 | } 103 | } 104 | 105 | /// A row with an NSDate as value where the user can select hour and minute as a countdown timer in a picker view. 106 | public final class CountDownRow: _CountDownRow, RowType { 107 | required public init(tag: String?) { 108 | super.init(tag: tag) 109 | onCellHighlight { cell, row in 110 | let color = cell.detailTextLabel?.textColor 111 | row.onCellUnHighlight { cell, _ in 112 | cell.detailTextLabel?.textColor = color 113 | } 114 | cell.detailTextLabel?.textColor = cell.tintColor 115 | } 116 | } 117 | } 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-BasePods-EurekaCreditCard_Tests/Pods-BasePods-EurekaCreditCard_Tests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | 86 | if [[ "$CONFIGURATION" == "Debug" ]]; then 87 | install_framework "$BUILT_PRODUCTS_DIR/BKMoneyKit/BKMoneyKit.framework" 88 | install_framework "$BUILT_PRODUCTS_DIR/Eureka/Eureka.framework" 89 | install_framework "$BUILT_PRODUCTS_DIR/EurekaCreditCard/EurekaCreditCard.framework" 90 | install_framework "$BUILT_PRODUCTS_DIR/FBSnapshotTestCase/FBSnapshotTestCase.framework" 91 | fi 92 | if [[ "$CONFIGURATION" == "Release" ]]; then 93 | install_framework "$BUILT_PRODUCTS_DIR/BKMoneyKit/BKMoneyKit.framework" 94 | install_framework "$BUILT_PRODUCTS_DIR/Eureka/Eureka.framework" 95 | install_framework "$BUILT_PRODUCTS_DIR/EurekaCreditCard/EurekaCreditCard.framework" 96 | install_framework "$BUILT_PRODUCTS_DIR/FBSnapshotTestCase/FBSnapshotTestCase.framework" 97 | fi 98 | -------------------------------------------------------------------------------- /Example/Pods/BKMoneyKit/BKMoneyKit/BKCardPatternInfo.m: -------------------------------------------------------------------------------- 1 | // 2 | // BKCardPatternInfo.m 3 | // BKMoneyKit 4 | // 5 | // Created by Byungkook Jang on 2014. 8. 23.. 6 | // Copyright (c) 2014년 Byungkook Jang. All rights reserved. 7 | // 8 | 9 | #import "BKCardPatternInfo.h" 10 | 11 | @interface BKCardPatternInfo () 12 | 13 | @property (nonatomic, strong) NSString *companyName; 14 | @property (nonatomic, strong) NSString *shortName; 15 | @property (nonatomic, strong) NSRegularExpression *patternRegularExpression; 16 | @property (nonatomic, strong) NSArray *numberGrouping; 17 | @property (nonatomic, strong) NSArray *lengths; 18 | @property (nonatomic) NSInteger maxLength; 19 | 20 | @end 21 | 22 | @implementation BKCardPatternInfo 23 | 24 | - (instancetype)initWithDictionary:(NSDictionary *)aDictionary 25 | { 26 | self = [super init]; 27 | if (self) { 28 | NSString *pattern = aDictionary[@"pattern"]; 29 | self.patternRegularExpression = [[NSRegularExpression alloc] initWithPattern:pattern options:0 error:nil]; 30 | self.companyName = aDictionary[@"companyName"]; 31 | self.shortName = aDictionary[@"shortName"]; 32 | self.numberGrouping = [[self class] numberArrayWithCommaSeparatedString:aDictionary[@"numberGrouping"] maxValue:NULL]; 33 | 34 | NSInteger maxLength; 35 | self.lengths = [[self class] numberArrayWithCommaSeparatedString:aDictionary[@"length"] maxValue:&maxLength]; 36 | self.maxLength = maxLength; 37 | } 38 | return self; 39 | } 40 | 41 | + (NSArray *)numberArrayWithCommaSeparatedString:(NSString *)aCommaSeparatedString maxValue:(NSInteger *)outMaxValue 42 | { 43 | NSArray *components = [aCommaSeparatedString componentsSeparatedByString:@","]; 44 | 45 | NSMutableArray *mutableResultArray = [NSMutableArray arrayWithCapacity:components.count]; 46 | 47 | NSInteger maxValue = 0; 48 | 49 | for (NSString *component in components) { 50 | NSInteger integer = component.integerValue; 51 | if (integer > 0) { 52 | [mutableResultArray addObject:@(integer)]; 53 | maxValue = MAX(maxValue, integer); 54 | } 55 | } 56 | 57 | if (outMaxValue) { 58 | *outMaxValue = maxValue; 59 | } 60 | 61 | return [NSArray arrayWithArray:mutableResultArray]; 62 | } 63 | 64 | - (BOOL)patternMatchesWithNumberString:(NSString *)aNumberString 65 | { 66 | NSUInteger numberOfMatches = [self.patternRegularExpression numberOfMatchesInString:aNumberString options:0 range:NSMakeRange(0, aNumberString.length)]; 67 | return numberOfMatches > 0; 68 | } 69 | 70 | - (NSString *)groupedStringWithString:(NSString *)aString groupSeparater:(NSString *)aGroupSeparater maskingCharacter:(NSString *)aMaskingCharacter maskingGroupIndexSet:(NSIndexSet *)aMaskingGroupIndexSet 71 | { 72 | if (aString.length == 0) { 73 | return @""; 74 | } 75 | 76 | if (aString.length > self.maxLength) { 77 | aString = [aString substringWithRange:NSMakeRange(0, self.maxLength)]; 78 | } 79 | 80 | NSMutableString *mutableString = [NSMutableString stringWithCapacity:aString.length + self.numberGrouping.count - 1]; 81 | 82 | NSInteger location = 0; 83 | 84 | for (NSInteger i = 0; i < self.numberGrouping.count; i++) { 85 | 86 | NSNumber *digitCountNumber = self.numberGrouping[i]; 87 | NSInteger digitCount = digitCountNumber.integerValue; 88 | 89 | NSRange substringRange = NSMakeRange(location, MIN(digitCount, aString.length - location)); 90 | 91 | if (aMaskingCharacter && [aMaskingGroupIndexSet containsIndex:i]) { 92 | NSString *maskString = [@"" stringByPaddingToLength:substringRange.length withString:aMaskingCharacter startingAtIndex:0]; 93 | [mutableString appendString:maskString]; 94 | } else { 95 | [mutableString appendString:[aString substringWithRange:substringRange]]; 96 | } 97 | 98 | location += substringRange.length; 99 | 100 | if (substringRange.length < digitCount) { 101 | break; 102 | } 103 | 104 | if (i < self.numberGrouping.count - 1) { 105 | [mutableString appendString:aGroupSeparater]; 106 | } 107 | } 108 | 109 | return [NSString stringWithString:mutableString]; 110 | } 111 | 112 | - (NSString *)description 113 | { 114 | return [NSString stringWithFormat:@"companyName=%@, shortName=%@, pattern=%@, numberGrouping=%@, lengths=%@", 115 | self.companyName, self.shortName, self.patternRegularExpression, self.numberGrouping, self.lengths]; 116 | } 117 | 118 | @end 119 | --------------------------------------------------------------------------------