├── .gitignore ├── .swift-version ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── Cartfile ├── Cartfile.resolved ├── CreditCardRow.podspec ├── CreditCardRow.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ └── CreditCardRow.xcscheme ├── CreditCardRow.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── CreditCardRow ├── CreditCardRow.h └── Info.plist ├── Example.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── Example ├── Example │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── CustomCell.xib │ ├── Info.plist │ └── ViewController.swift ├── ExampleUITests │ ├── CreditCardRowTests.swift │ └── Info.plist └── MyCreditCardRow.swift ├── LICENSE ├── Media ├── CreditCardRow.gif ├── CreditCardRowCustom.gif └── row-parameters.png ├── README.md ├── Sources ├── CreditCardCell.swift ├── CreditCardCell.xib ├── CreditCardRow.swift ├── PaddedTextField.swift └── String+CreditCardRow.swift └── Tests ├── CreditCardRowTests.swift └── Info.plist /.gitignore: -------------------------------------------------------------------------------- 1 | ## OS X Finder 2 | .DS_Store 3 | 4 | ## Build generated 5 | build/ 6 | DerivedData 7 | 8 | ## Various settings 9 | *.pbxuser 10 | !default.pbxuser 11 | *.mode1v3 12 | !default.mode1v3 13 | *.mode2v3 14 | !default.mode2v3 15 | *.perspectivev3 16 | !default.perspectivev3 17 | xcuserdata 18 | 19 | ## Other 20 | *.xccheckout 21 | *.moved-aside 22 | *.xcuserstate 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | 29 | ## Playgrounds 30 | timeline.xctimeline 31 | playground.xcworkspace 32 | 33 | # Swift Package Manager 34 | # 35 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 36 | # Packages/ 37 | .build/ 38 | 39 | # CocoaPods 40 | # 41 | # We recommend against adding the Pods directory to your .gitignore. However 42 | # you should judge for yourself, the pros and cons are mentioned at: 43 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 44 | # 45 | Pods/ 46 | 47 | # Carthage 48 | # 49 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 50 | Carthage/ 51 | 52 | Carthage/Build 53 | Frameworks/ 54 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 5.0 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode10.2 3 | env: 4 | - DESTINATION="OS=12.0,name=iPhone X" SCHEME="CreditCardRow" SDK=iphonesimulator 5 | 6 | before_install: 7 | - brew update 8 | - brew outdated carthage || brew upgrade carthage 9 | - carthage update --platform iOS 10 | - gem install xcpretty --quiet 11 | 12 | script: 13 | - xcodebuild clean build -project CreditCardRow.xcodeproj -scheme "$SCHEME" -sdk "$SDK" 14 | - xcodebuild -project CreditCardRow.xcodeproj -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO test | xcpretty -c 15 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to CreditCardRow will be documented in this file. 3 | 4 | ### [3.2.0](https://github.com/EurekaCommunity/GenericPasswordRow/releases/tag/3.2.0) 5 | 6 | 7 | * Adds support for Eureka ~> 5.x 8 | * Swift 5 support 9 | 10 | ### [3.1.0](https://github.com/EurekaCommunity/GenericPasswordRow/releases/tag/3.1.0) 11 | 12 | 13 | * Adds support for Eureka ~> 4.x 14 | 15 | ### [3.0.0](https://github.com/EurekaCommunity/GenericPasswordRow/releases/tag/3.0.0) 16 | 17 | 18 | * Adds support for Xcode 9 (Swift 4) 19 | 20 | ### [2.1.0](https://github.com/EurekaCommunity/GenericPasswordRow/releases/tag/2.1.0) 21 | 22 | 23 | * Added Eureka 3.0.0 support 24 | 25 | ### [2.0.0](https://github.com/xmartlabs/CreditCardRow/releases/tag/2.0.0) 26 | 27 | 28 | * Swift 3 compatibility. 29 | 30 | ### [1.0.0](https://github.com/xmartlabs/CreditCardRow/releases/tag/1.0.0) 31 | 32 | 33 | * This is the initial version. 34 | 35 | [xmartlabs]: https://xmartlabs.com 36 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributing Guidelines 2 | -------------------------------------------------- 3 | 4 | This document provides general guidelines about how to contribute to the project. Keep in mind these important things before you start contributing. 5 | 6 | ### Asking Questions 7 | 8 | We do not use github issues for general library support. We think this questions should be posted on stack overflow using [CreditCardRow](http://http://stackoverflow.com/questions/tagged/CreditCardRow) tag. 9 | 10 | ### Reporting issues 11 | 12 | * Use [github issues](https://github.com/xmartlabs/CreditCardRow/issues) to report a bug. 13 | * Before creating a new issue: 14 | * Make sure you are using the [latest release](https://github.com/xmartlabs/CreditCardRow/releases). 15 | * Check if the issue was [already reported or fixed](https://github.com/xmartlabs/CreditCardRow/issues?utf8=%E2%9C%93&q=is%3Aissue). Notice that it may not be released yet. 16 | * If you found a match add a brief comment "I have the same problem" or "+1". This helps prioritize the issues addressing the most common and critical first. If possible add additional information to help us reproduce and fix the issue. Please use your best judgement. 17 | * Reporting issues: 18 | * Please include the following information to help maintainers to fix the problem faster: 19 | * Xcode version you are using. 20 | * iOS version you are targeting. 21 | * Full Xcode console output of stack trace or code compilation error. 22 | * Any other additional detail you think it would be useful to understand and solve the problem. 23 | 24 | 25 | ### Pull requests 26 | 27 | The easiest way to start contributing is searching open issues by `help wanted` tag. We also add a `difficulty` tag (difficulty: easy, difficulty: moderate, difficulty: hard) in order to give an idea of how complex it can be to implement the feature according maintainers project experience. 28 | 29 | * Add test coverage to the feature or fix. We only accept new feature pull requests that have related test coverage. This allows us to keep the library stable as we move forward. 30 | * Remember to document the new feature. We do not accept new feature pull requests without its associated documentation. 31 | * In case of a new feature please update the example project showing the feature. 32 | * Please only one fix or feature per pull request. This will increase the chances your feature will be merged. 33 | 34 | 35 | ###### Suggested git workflow to contribute 36 | 37 | 1. Fork the CreditCardRow repository. 38 | 2. Clone your forked project into your developer machine: `git clone git@github.com:/CreditCardRow.git` 39 | 3. Add the original project repo as upstream repository in your forked project: `git remote add upstream git@github.com:xmartlabs/CreditCardRow.git` 40 | 4. Before starting a new feature make sure your forked master branch is synchronized upstream master branch. Considering you do not mere your pull request into master you can run: `git checkout master` and then `git pull upstream master`. Optionally `git push origin master`. 41 | 5. Create a new branch. Note that the starting point is the upstream master branch HEAD. `git checkout -b my-feature-name` 42 | 6. Stage all your changes `git add .` and commit them `git commit -m "Your commit message"` 43 | 7. Make sure your branch is up to date with upstream master, `git pull --rebase upstream master`, resolve conflicts if necessary. This will move your commit to the top of git stack. 44 | 8. Squash your commits into one commit. `git rebase -i HEAD~6` considering you did 6 commits. 45 | 9. Push your branch into your forked remote repository. 46 | 10. Create a new pull request adding any useful comment. 47 | 48 | 49 | ###### Code style and conventions 50 | 51 | We try to follow our [swift style guide](https://github.com/xmartlabs/Swift-Style-Guide). Following it is not strictly necessary to contribute and to have a pull request accepted but project maintainers try to follow it. We would love to hear your ideas to improve our code style and conventions. Feel free to contribute. 52 | 53 | 54 | ### Feature proposal 55 | 56 | We would love to hear your ideas and make a discussions about it. 57 | 58 | * Use github issues to make feature proposals. 59 | * We use `type: feature request` label to mark all [feature request issues](https://github.com/xmartlabs/CreditCardRow/labels/type%3A%20feature%20request). 60 | * Before submitting your proposal make sure there is no similar feature request. If you found a match feel free to join the discussion or just add a brief "+1" if you think the feature is worth implementing. 61 | * Be as specific as possible providing a precise explanation of feature request so anyone can understand the problem and the benefits of solving it. 62 | -------------------------------------------------------------------------------- /Cartfile: -------------------------------------------------------------------------------- 1 | github "xmartlabs/Eureka" ~> 5.0 2 | -------------------------------------------------------------------------------- /Cartfile.resolved: -------------------------------------------------------------------------------- 1 | github "xmartlabs/Eureka" "5.0.0" 2 | -------------------------------------------------------------------------------- /CreditCardRow.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "CreditCardRow" 3 | s.version = "3.2.0" 4 | s.summary = "An Eureka row that allows the user to input a credit card number with optional CVC and expiration date." 5 | s.homepage = "https://github.com/EurekaCommunity/CreditCardRow" 6 | s.license = { type: 'MIT', file: 'LICENSE' } 7 | s.author = { "Xmartlabs SRL" => "swift@xmartlabs.com" } 8 | s.source = { git: "https://github.com/EurekaCommunity/CreditCardRow.git", tag: s.version.to_s } 9 | s.social_media_url = 'https://twitter.com/xmartlabs' 10 | s.ios.deployment_target = '9.3' 11 | s.requires_arc = true 12 | s.ios.source_files = 'Sources/**/*.swift' 13 | s.resource_bundles = { 14 | 'CreditCardRow' => ['Sources/CreditCardCell.xib'] 15 | } 16 | s.ios.frameworks = 'UIKit', 'Foundation' 17 | s.dependency 'Eureka', '~> 5.0' 18 | s.swift_version = '5.0' 19 | end 20 | -------------------------------------------------------------------------------- /CreditCardRow.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 28F828811C494B2C00330CF4 /* CreditCardRow.h in Headers */ = {isa = PBXBuildFile; fileRef = 28F828801C494B2C00330CF4 /* CreditCardRow.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | 28F8289A1C494B4200330CF4 /* CreditCardCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28F828991C494B4200330CF4 /* CreditCardCell.swift */; }; 12 | 8F7E922B1D78B0D1002BEFC3 /* Eureka.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F7E92291D78B0D1002BEFC3 /* Eureka.framework */; }; 13 | 8F7E922E1D78B335002BEFC3 /* PaddedTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F7E922D1D78B335002BEFC3 /* PaddedTextField.swift */; }; 14 | 8F7E92311D78BA29002BEFC3 /* CreditCardRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F7E92301D78BA29002BEFC3 /* CreditCardRow.swift */; }; 15 | 8F9B3A0A1D7DBA12005F8273 /* String+CreditCardRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F9B3A091D7DBA12005F8273 /* String+CreditCardRow.swift */; }; 16 | 8FD114E61D79F8B6006976C8 /* CreditCardCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8FD114E51D79F8B6006976C8 /* CreditCardCell.xib */; }; 17 | CB3F7D851F8BF41900C856E5 /* CreditCardRowTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB3F7D831F8BF41900C856E5 /* CreditCardRowTests.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | 28F828891C494B2C00330CF4 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = 28F828741C494B2C00330CF4 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = 28F8287C1C494B2C00330CF4; 26 | remoteInfo = CreditCardRow; 27 | }; 28 | /* End PBXContainerItemProxy section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | 28F8287D1C494B2C00330CF4 /* CreditCardRow.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CreditCardRow.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | 28F828801C494B2C00330CF4 /* CreditCardRow.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CreditCardRow.h; sourceTree = ""; }; 33 | 28F828821C494B2C00330CF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 34 | 28F828871C494B2C00330CF4 /* CreditCardRowTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CreditCardRowTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | 28F828991C494B4200330CF4 /* CreditCardCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CreditCardCell.swift; sourceTree = ""; }; 36 | 8F7E92291D78B0D1002BEFC3 /* Eureka.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Eureka.framework; path = Carthage/Build/iOS/Eureka.framework; sourceTree = ""; }; 37 | 8F7E922D1D78B335002BEFC3 /* PaddedTextField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PaddedTextField.swift; sourceTree = ""; }; 38 | 8F7E92301D78BA29002BEFC3 /* CreditCardRow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CreditCardRow.swift; sourceTree = ""; }; 39 | 8F9B3A091D7DBA12005F8273 /* String+CreditCardRow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+CreditCardRow.swift"; sourceTree = ""; }; 40 | 8FD114E51D79F8B6006976C8 /* CreditCardCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CreditCardCell.xib; sourceTree = ""; }; 41 | CB3F7D831F8BF41900C856E5 /* CreditCardRowTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CreditCardRowTests.swift; path = Tests/CreditCardRowTests.swift; sourceTree = SOURCE_ROOT; }; 42 | CB3F7D841F8BF41900C856E5 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = ExampleUITests/Info.plist; sourceTree = SOURCE_ROOT; }; 43 | /* End PBXFileReference section */ 44 | 45 | /* Begin PBXFrameworksBuildPhase section */ 46 | 28F828791C494B2C00330CF4 /* Frameworks */ = { 47 | isa = PBXFrameworksBuildPhase; 48 | buildActionMask = 2147483647; 49 | files = ( 50 | 8F7E922B1D78B0D1002BEFC3 /* Eureka.framework in Frameworks */, 51 | ); 52 | runOnlyForDeploymentPostprocessing = 0; 53 | }; 54 | 28F828841C494B2C00330CF4 /* Frameworks */ = { 55 | isa = PBXFrameworksBuildPhase; 56 | buildActionMask = 2147483647; 57 | files = ( 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXFrameworksBuildPhase section */ 62 | 63 | /* Begin PBXGroup section */ 64 | 28F828731C494B2C00330CF4 = { 65 | isa = PBXGroup; 66 | children = ( 67 | 28F828971C494B4200330CF4 /* Sources */, 68 | 28F8287F1C494B2C00330CF4 /* CreditCardRow */, 69 | CB3F7D7A1F8BF1BD00C856E5 /* Tests */, 70 | 8F7E92281D78B0B7002BEFC3 /* Frameworks */, 71 | 28F8287E1C494B2C00330CF4 /* Products */, 72 | ); 73 | sourceTree = ""; 74 | }; 75 | 28F8287E1C494B2C00330CF4 /* Products */ = { 76 | isa = PBXGroup; 77 | children = ( 78 | 28F8287D1C494B2C00330CF4 /* CreditCardRow.framework */, 79 | 28F828871C494B2C00330CF4 /* CreditCardRowTests.xctest */, 80 | ); 81 | name = Products; 82 | sourceTree = ""; 83 | }; 84 | 28F8287F1C494B2C00330CF4 /* CreditCardRow */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | 28F828801C494B2C00330CF4 /* CreditCardRow.h */, 88 | 28F828821C494B2C00330CF4 /* Info.plist */, 89 | ); 90 | path = CreditCardRow; 91 | sourceTree = ""; 92 | }; 93 | 28F828971C494B4200330CF4 /* Sources */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 8F7E92301D78BA29002BEFC3 /* CreditCardRow.swift */, 97 | 28F828991C494B4200330CF4 /* CreditCardCell.swift */, 98 | 8FD114E51D79F8B6006976C8 /* CreditCardCell.xib */, 99 | 8F7E922D1D78B335002BEFC3 /* PaddedTextField.swift */, 100 | 8F9B3A091D7DBA12005F8273 /* String+CreditCardRow.swift */, 101 | ); 102 | path = Sources; 103 | sourceTree = SOURCE_ROOT; 104 | }; 105 | 8F7E92281D78B0B7002BEFC3 /* Frameworks */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 8F7E92291D78B0D1002BEFC3 /* Eureka.framework */, 109 | ); 110 | name = Frameworks; 111 | sourceTree = ""; 112 | }; 113 | CB3F7D7A1F8BF1BD00C856E5 /* Tests */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | CB3F7D831F8BF41900C856E5 /* CreditCardRowTests.swift */, 117 | CB3F7D841F8BF41900C856E5 /* Info.plist */, 118 | ); 119 | name = Tests; 120 | path = Test; 121 | sourceTree = ""; 122 | }; 123 | /* End PBXGroup section */ 124 | 125 | /* Begin PBXHeadersBuildPhase section */ 126 | 28F8287A1C494B2C00330CF4 /* Headers */ = { 127 | isa = PBXHeadersBuildPhase; 128 | buildActionMask = 2147483647; 129 | files = ( 130 | 28F828811C494B2C00330CF4 /* CreditCardRow.h in Headers */, 131 | ); 132 | runOnlyForDeploymentPostprocessing = 0; 133 | }; 134 | /* End PBXHeadersBuildPhase section */ 135 | 136 | /* Begin PBXNativeTarget section */ 137 | 28F8287C1C494B2C00330CF4 /* CreditCardRow */ = { 138 | isa = PBXNativeTarget; 139 | buildConfigurationList = 28F828911C494B2C00330CF4 /* Build configuration list for PBXNativeTarget "CreditCardRow" */; 140 | buildPhases = ( 141 | 28F828781C494B2C00330CF4 /* Sources */, 142 | 28F828791C494B2C00330CF4 /* Frameworks */, 143 | 28F8287A1C494B2C00330CF4 /* Headers */, 144 | 28F8287B1C494B2C00330CF4 /* Resources */, 145 | 8FDE775D1D78C82E00A94698 /* Copy Frameworks */, 146 | ); 147 | buildRules = ( 148 | ); 149 | dependencies = ( 150 | ); 151 | name = CreditCardRow; 152 | productName = CreditCardRow; 153 | productReference = 28F8287D1C494B2C00330CF4 /* CreditCardRow.framework */; 154 | productType = "com.apple.product-type.framework"; 155 | }; 156 | 28F828861C494B2C00330CF4 /* CreditCardRowTests */ = { 157 | isa = PBXNativeTarget; 158 | buildConfigurationList = 28F828941C494B2C00330CF4 /* Build configuration list for PBXNativeTarget "CreditCardRowTests" */; 159 | buildPhases = ( 160 | 28F828831C494B2C00330CF4 /* Sources */, 161 | 28F828841C494B2C00330CF4 /* Frameworks */, 162 | 28F828851C494B2C00330CF4 /* Resources */, 163 | ); 164 | buildRules = ( 165 | ); 166 | dependencies = ( 167 | 28F8288A1C494B2C00330CF4 /* PBXTargetDependency */, 168 | ); 169 | name = CreditCardRowTests; 170 | productName = CreditCardRowTests; 171 | productReference = 28F828871C494B2C00330CF4 /* CreditCardRowTests.xctest */; 172 | productType = "com.apple.product-type.bundle.unit-test"; 173 | }; 174 | /* End PBXNativeTarget section */ 175 | 176 | /* Begin PBXProject section */ 177 | 28F828741C494B2C00330CF4 /* Project object */ = { 178 | isa = PBXProject; 179 | attributes = { 180 | LastSwiftUpdateCheck = 0720; 181 | LastUpgradeCheck = 1020; 182 | TargetAttributes = { 183 | 28F8287C1C494B2C00330CF4 = { 184 | CreatedOnToolsVersion = 7.2; 185 | LastSwiftMigration = 1020; 186 | }; 187 | 28F828861C494B2C00330CF4 = { 188 | CreatedOnToolsVersion = 7.2; 189 | LastSwiftMigration = 1020; 190 | }; 191 | }; 192 | }; 193 | buildConfigurationList = 28F828771C494B2C00330CF4 /* Build configuration list for PBXProject "CreditCardRow" */; 194 | compatibilityVersion = "Xcode 3.2"; 195 | developmentRegion = en; 196 | hasScannedForEncodings = 0; 197 | knownRegions = ( 198 | en, 199 | Base, 200 | ); 201 | mainGroup = 28F828731C494B2C00330CF4; 202 | productRefGroup = 28F8287E1C494B2C00330CF4 /* Products */; 203 | projectDirPath = ""; 204 | projectRoot = ""; 205 | targets = ( 206 | 28F8287C1C494B2C00330CF4 /* CreditCardRow */, 207 | 28F828861C494B2C00330CF4 /* CreditCardRowTests */, 208 | ); 209 | }; 210 | /* End PBXProject section */ 211 | 212 | /* Begin PBXResourcesBuildPhase section */ 213 | 28F8287B1C494B2C00330CF4 /* Resources */ = { 214 | isa = PBXResourcesBuildPhase; 215 | buildActionMask = 2147483647; 216 | files = ( 217 | 8FD114E61D79F8B6006976C8 /* CreditCardCell.xib in Resources */, 218 | ); 219 | runOnlyForDeploymentPostprocessing = 0; 220 | }; 221 | 28F828851C494B2C00330CF4 /* Resources */ = { 222 | isa = PBXResourcesBuildPhase; 223 | buildActionMask = 2147483647; 224 | files = ( 225 | ); 226 | runOnlyForDeploymentPostprocessing = 0; 227 | }; 228 | /* End PBXResourcesBuildPhase section */ 229 | 230 | /* Begin PBXShellScriptBuildPhase section */ 231 | 8FDE775D1D78C82E00A94698 /* Copy Frameworks */ = { 232 | isa = PBXShellScriptBuildPhase; 233 | buildActionMask = 2147483647; 234 | files = ( 235 | ); 236 | inputPaths = ( 237 | "$(SRCROOT)/Carthage/Build/iOS/Eureka.framework", 238 | ); 239 | name = "Copy Frameworks"; 240 | outputPaths = ( 241 | ); 242 | runOnlyForDeploymentPostprocessing = 0; 243 | shellPath = /bin/sh; 244 | shellScript = "/usr/local/bin/carthage copy-frameworks"; 245 | }; 246 | /* End PBXShellScriptBuildPhase section */ 247 | 248 | /* Begin PBXSourcesBuildPhase section */ 249 | 28F828781C494B2C00330CF4 /* Sources */ = { 250 | isa = PBXSourcesBuildPhase; 251 | buildActionMask = 2147483647; 252 | files = ( 253 | 8F9B3A0A1D7DBA12005F8273 /* String+CreditCardRow.swift in Sources */, 254 | 8F7E92311D78BA29002BEFC3 /* CreditCardRow.swift in Sources */, 255 | 28F8289A1C494B4200330CF4 /* CreditCardCell.swift in Sources */, 256 | 8F7E922E1D78B335002BEFC3 /* PaddedTextField.swift in Sources */, 257 | ); 258 | runOnlyForDeploymentPostprocessing = 0; 259 | }; 260 | 28F828831C494B2C00330CF4 /* Sources */ = { 261 | isa = PBXSourcesBuildPhase; 262 | buildActionMask = 2147483647; 263 | files = ( 264 | CB3F7D851F8BF41900C856E5 /* CreditCardRowTests.swift in Sources */, 265 | ); 266 | runOnlyForDeploymentPostprocessing = 0; 267 | }; 268 | /* End PBXSourcesBuildPhase section */ 269 | 270 | /* Begin PBXTargetDependency section */ 271 | 28F8288A1C494B2C00330CF4 /* PBXTargetDependency */ = { 272 | isa = PBXTargetDependency; 273 | target = 28F8287C1C494B2C00330CF4 /* CreditCardRow */; 274 | targetProxy = 28F828891C494B2C00330CF4 /* PBXContainerItemProxy */; 275 | }; 276 | /* End PBXTargetDependency section */ 277 | 278 | /* Begin XCBuildConfiguration section */ 279 | 28F8288F1C494B2C00330CF4 /* Debug */ = { 280 | isa = XCBuildConfiguration; 281 | buildSettings = { 282 | ALWAYS_SEARCH_USER_PATHS = NO; 283 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 284 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 285 | CLANG_CXX_LIBRARY = "libc++"; 286 | CLANG_ENABLE_MODULES = YES; 287 | CLANG_ENABLE_OBJC_ARC = YES; 288 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 289 | CLANG_WARN_BOOL_CONVERSION = YES; 290 | CLANG_WARN_COMMA = YES; 291 | CLANG_WARN_CONSTANT_CONVERSION = YES; 292 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 293 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 294 | CLANG_WARN_EMPTY_BODY = YES; 295 | CLANG_WARN_ENUM_CONVERSION = YES; 296 | CLANG_WARN_INFINITE_RECURSION = YES; 297 | CLANG_WARN_INT_CONVERSION = YES; 298 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 299 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 300 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 301 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 302 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 303 | CLANG_WARN_STRICT_PROTOTYPES = YES; 304 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 305 | CLANG_WARN_UNREACHABLE_CODE = YES; 306 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 307 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 308 | COPY_PHASE_STRIP = NO; 309 | CURRENT_PROJECT_VERSION = 1; 310 | DEBUG_INFORMATION_FORMAT = dwarf; 311 | ENABLE_STRICT_OBJC_MSGSEND = YES; 312 | ENABLE_TESTABILITY = YES; 313 | GCC_C_LANGUAGE_STANDARD = gnu99; 314 | GCC_DYNAMIC_NO_PIC = NO; 315 | GCC_NO_COMMON_BLOCKS = YES; 316 | GCC_OPTIMIZATION_LEVEL = 0; 317 | GCC_PREPROCESSOR_DEFINITIONS = ( 318 | "DEBUG=1", 319 | "$(inherited)", 320 | ); 321 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 322 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 323 | GCC_WARN_UNDECLARED_SELECTOR = YES; 324 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 325 | GCC_WARN_UNUSED_FUNCTION = YES; 326 | GCC_WARN_UNUSED_VARIABLE = YES; 327 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 328 | MTL_ENABLE_DEBUG_INFO = YES; 329 | ONLY_ACTIVE_ARCH = YES; 330 | SDKROOT = iphoneos; 331 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 332 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 333 | TARGETED_DEVICE_FAMILY = "1,2"; 334 | VERSIONING_SYSTEM = "apple-generic"; 335 | VERSION_INFO_PREFIX = ""; 336 | }; 337 | name = Debug; 338 | }; 339 | 28F828901C494B2C00330CF4 /* Release */ = { 340 | isa = XCBuildConfiguration; 341 | buildSettings = { 342 | ALWAYS_SEARCH_USER_PATHS = NO; 343 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 344 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 345 | CLANG_CXX_LIBRARY = "libc++"; 346 | CLANG_ENABLE_MODULES = YES; 347 | CLANG_ENABLE_OBJC_ARC = YES; 348 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 349 | CLANG_WARN_BOOL_CONVERSION = YES; 350 | CLANG_WARN_COMMA = YES; 351 | CLANG_WARN_CONSTANT_CONVERSION = YES; 352 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 353 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 354 | CLANG_WARN_EMPTY_BODY = YES; 355 | CLANG_WARN_ENUM_CONVERSION = YES; 356 | CLANG_WARN_INFINITE_RECURSION = YES; 357 | CLANG_WARN_INT_CONVERSION = YES; 358 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 359 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 360 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 361 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 362 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 363 | CLANG_WARN_STRICT_PROTOTYPES = YES; 364 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 365 | CLANG_WARN_UNREACHABLE_CODE = YES; 366 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 367 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 368 | COPY_PHASE_STRIP = NO; 369 | CURRENT_PROJECT_VERSION = 1; 370 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 371 | ENABLE_NS_ASSERTIONS = NO; 372 | ENABLE_STRICT_OBJC_MSGSEND = YES; 373 | GCC_C_LANGUAGE_STANDARD = gnu99; 374 | GCC_NO_COMMON_BLOCKS = YES; 375 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 376 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 377 | GCC_WARN_UNDECLARED_SELECTOR = YES; 378 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 379 | GCC_WARN_UNUSED_FUNCTION = YES; 380 | GCC_WARN_UNUSED_VARIABLE = YES; 381 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 382 | MTL_ENABLE_DEBUG_INFO = NO; 383 | SDKROOT = iphoneos; 384 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 385 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 386 | TARGETED_DEVICE_FAMILY = "1,2"; 387 | VALIDATE_PRODUCT = YES; 388 | VERSIONING_SYSTEM = "apple-generic"; 389 | VERSION_INFO_PREFIX = ""; 390 | }; 391 | name = Release; 392 | }; 393 | 28F828921C494B2C00330CF4 /* Debug */ = { 394 | isa = XCBuildConfiguration; 395 | buildSettings = { 396 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 397 | DEFINES_MODULE = YES; 398 | DYLIB_COMPATIBILITY_VERSION = 1; 399 | DYLIB_CURRENT_VERSION = 1; 400 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 401 | FRAMEWORK_SEARCH_PATHS = ( 402 | "$(inherited)", 403 | "$(PROJECT_DIR)/Carthage/Build/iOS", 404 | ); 405 | INFOPLIST_FILE = CreditCardRow/Info.plist; 406 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 407 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 408 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 409 | PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.CreditCardRow; 410 | PRODUCT_NAME = "$(TARGET_NAME)"; 411 | SKIP_INSTALL = YES; 412 | SWIFT_VERSION = 5.0; 413 | }; 414 | name = Debug; 415 | }; 416 | 28F828931C494B2C00330CF4 /* Release */ = { 417 | isa = XCBuildConfiguration; 418 | buildSettings = { 419 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 420 | DEFINES_MODULE = YES; 421 | DYLIB_COMPATIBILITY_VERSION = 1; 422 | DYLIB_CURRENT_VERSION = 1; 423 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 424 | FRAMEWORK_SEARCH_PATHS = ( 425 | "$(inherited)", 426 | "$(PROJECT_DIR)/Carthage/Build/iOS", 427 | ); 428 | INFOPLIST_FILE = CreditCardRow/Info.plist; 429 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 430 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 431 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 432 | PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.CreditCardRow; 433 | PRODUCT_NAME = "$(TARGET_NAME)"; 434 | SKIP_INSTALL = YES; 435 | SWIFT_VERSION = 5.0; 436 | }; 437 | name = Release; 438 | }; 439 | 28F828951C494B2C00330CF4 /* Debug */ = { 440 | isa = XCBuildConfiguration; 441 | buildSettings = { 442 | CLANG_ENABLE_MODULES = YES; 443 | INFOPLIST_FILE = Tests/Info.plist; 444 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 445 | PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.CreditCardRowTests; 446 | PRODUCT_NAME = "$(TARGET_NAME)"; 447 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 448 | SWIFT_VERSION = 5.0; 449 | }; 450 | name = Debug; 451 | }; 452 | 28F828961C494B2C00330CF4 /* Release */ = { 453 | isa = XCBuildConfiguration; 454 | buildSettings = { 455 | CLANG_ENABLE_MODULES = YES; 456 | INFOPLIST_FILE = Tests/Info.plist; 457 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 458 | PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.CreditCardRowTests; 459 | PRODUCT_NAME = "$(TARGET_NAME)"; 460 | SWIFT_VERSION = 5.0; 461 | }; 462 | name = Release; 463 | }; 464 | /* End XCBuildConfiguration section */ 465 | 466 | /* Begin XCConfigurationList section */ 467 | 28F828771C494B2C00330CF4 /* Build configuration list for PBXProject "CreditCardRow" */ = { 468 | isa = XCConfigurationList; 469 | buildConfigurations = ( 470 | 28F8288F1C494B2C00330CF4 /* Debug */, 471 | 28F828901C494B2C00330CF4 /* Release */, 472 | ); 473 | defaultConfigurationIsVisible = 0; 474 | defaultConfigurationName = Release; 475 | }; 476 | 28F828911C494B2C00330CF4 /* Build configuration list for PBXNativeTarget "CreditCardRow" */ = { 477 | isa = XCConfigurationList; 478 | buildConfigurations = ( 479 | 28F828921C494B2C00330CF4 /* Debug */, 480 | 28F828931C494B2C00330CF4 /* Release */, 481 | ); 482 | defaultConfigurationIsVisible = 0; 483 | defaultConfigurationName = Release; 484 | }; 485 | 28F828941C494B2C00330CF4 /* Build configuration list for PBXNativeTarget "CreditCardRowTests" */ = { 486 | isa = XCConfigurationList; 487 | buildConfigurations = ( 488 | 28F828951C494B2C00330CF4 /* Debug */, 489 | 28F828961C494B2C00330CF4 /* Release */, 490 | ); 491 | defaultConfigurationIsVisible = 0; 492 | defaultConfigurationName = Release; 493 | }; 494 | /* End XCConfigurationList section */ 495 | }; 496 | rootObject = 28F828741C494B2C00330CF4 /* Project object */; 497 | } 498 | -------------------------------------------------------------------------------- /CreditCardRow.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CreditCardRow.xcodeproj/xcshareddata/xcschemes/CreditCardRow.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 65 | 71 | 72 | 73 | 74 | 75 | 76 | 82 | 83 | 89 | 90 | 91 | 92 | 94 | 95 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /CreditCardRow.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /CreditCardRow.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CreditCardRow/CreditCardRow.h: -------------------------------------------------------------------------------- 1 | // 2 | // CreditCardRow.h 3 | // CreditCardRow 4 | // 5 | // Copyright © 2016 Xmartlabs SRL. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | //! Project version number for CreditCardRow. 11 | FOUNDATION_EXPORT double CreditCardRowVersionNumber; 12 | 13 | //! Project version string for CreditCardRow. 14 | FOUNDATION_EXPORT const unsigned char CreditCardRowVersionString[]; 15 | 16 | // In this header, you should import all the public headers of your framework using statements like #import 17 | 18 | 19 | -------------------------------------------------------------------------------- /CreditCardRow/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 28F828D01C4B714D00330CF4 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28F828CF1C4B714D00330CF4 /* AppDelegate.swift */; }; 11 | 28F828D21C4B714D00330CF4 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28F828D11C4B714D00330CF4 /* ViewController.swift */; }; 12 | 28F828D51C4B714D00330CF4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 28F828D31C4B714D00330CF4 /* Main.storyboard */; }; 13 | 28F828D71C4B714D00330CF4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 28F828D61C4B714D00330CF4 /* Assets.xcassets */; }; 14 | 28F828DA1C4B714D00330CF4 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 28F828D81C4B714D00330CF4 /* LaunchScreen.storyboard */; }; 15 | 8F9B3A061D7DB064005F8273 /* CustomCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8F9B3A051D7DB064005F8273 /* CustomCell.xib */; }; 16 | 8F9B3A081D7DB2C2005F8273 /* MyCreditCardRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F9B3A071D7DB2C2005F8273 /* MyCreditCardRow.swift */; }; 17 | 8FD114E01D79F685006976C8 /* CreditCardRow.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 287D0A7A1C4B7B26004566D6 /* CreditCardRow.framework */; }; 18 | 8FD114E11D79F685006976C8 /* CreditCardRow.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 287D0A7A1C4B7B26004566D6 /* CreditCardRow.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 19 | 8FDE775F1D78C9B200A94698 /* Eureka.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8FDE775E1D78C9B200A94698 /* Eureka.framework */; }; 20 | 8FDE77601D78C9B200A94698 /* Eureka.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8FDE775E1D78C9B200A94698 /* Eureka.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 21 | CB3F7D931F8BF6E100C856E5 /* CreditCardRowTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB3F7D911F8BF6E100C856E5 /* CreditCardRowTests.swift */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXContainerItemProxy section */ 25 | 287D0A791C4B7B26004566D6 /* PBXContainerItemProxy */ = { 26 | isa = PBXContainerItemProxy; 27 | containerPortal = 287D0A741C4B7B26004566D6 /* CreditCardRow.xcodeproj */; 28 | proxyType = 2; 29 | remoteGlobalIDString = 28F8287D1C494B2C00330CF4; 30 | remoteInfo = CreditCardRow; 31 | }; 32 | 287D0A7B1C4B7B26004566D6 /* PBXContainerItemProxy */ = { 33 | isa = PBXContainerItemProxy; 34 | containerPortal = 287D0A741C4B7B26004566D6 /* CreditCardRow.xcodeproj */; 35 | proxyType = 2; 36 | remoteGlobalIDString = 28F828871C494B2C00330CF4; 37 | remoteInfo = CreditCardRowTests; 38 | }; 39 | 28F828E11C4B714D00330CF4 /* PBXContainerItemProxy */ = { 40 | isa = PBXContainerItemProxy; 41 | containerPortal = 28F828C41C4B714D00330CF4 /* Project object */; 42 | proxyType = 1; 43 | remoteGlobalIDString = 28F828CB1C4B714D00330CF4; 44 | remoteInfo = Example; 45 | }; 46 | 8FD114E21D79F685006976C8 /* PBXContainerItemProxy */ = { 47 | isa = PBXContainerItemProxy; 48 | containerPortal = 287D0A741C4B7B26004566D6 /* CreditCardRow.xcodeproj */; 49 | proxyType = 1; 50 | remoteGlobalIDString = 28F8287C1C494B2C00330CF4; 51 | remoteInfo = CreditCardRow; 52 | }; 53 | /* End PBXContainerItemProxy section */ 54 | 55 | /* Begin PBXCopyFilesBuildPhase section */ 56 | 287D0A811C4B7B55004566D6 /* Embed Frameworks */ = { 57 | isa = PBXCopyFilesBuildPhase; 58 | buildActionMask = 2147483647; 59 | dstPath = ""; 60 | dstSubfolderSpec = 10; 61 | files = ( 62 | 8FDE77601D78C9B200A94698 /* Eureka.framework in Embed Frameworks */, 63 | 8FD114E11D79F685006976C8 /* CreditCardRow.framework in Embed Frameworks */, 64 | ); 65 | name = "Embed Frameworks"; 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | /* End PBXCopyFilesBuildPhase section */ 69 | 70 | /* Begin PBXFileReference section */ 71 | 287D0A741C4B7B26004566D6 /* CreditCardRow.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = CreditCardRow.xcodeproj; sourceTree = ""; }; 72 | 28F828CC1C4B714D00330CF4 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 73 | 28F828CF1C4B714D00330CF4 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = Example/AppDelegate.swift; sourceTree = ""; }; 74 | 28F828D11C4B714D00330CF4 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ViewController.swift; path = Example/ViewController.swift; sourceTree = ""; }; 75 | 28F828D41C4B714D00330CF4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 76 | 28F828D61C4B714D00330CF4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Example/Assets.xcassets; sourceTree = ""; }; 77 | 28F828D91C4B714D00330CF4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 78 | 28F828DB1C4B714D00330CF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Example/Info.plist; sourceTree = ""; }; 79 | 28F828E01C4B714D00330CF4 /* ExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 80 | 8F9B3A051D7DB064005F8273 /* CustomCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = CustomCell.xib; path = Example/CustomCell.xib; sourceTree = ""; }; 81 | 8F9B3A071D7DB2C2005F8273 /* MyCreditCardRow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MyCreditCardRow.swift; sourceTree = ""; }; 82 | 8FDE775E1D78C9B200A94698 /* Eureka.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Eureka.framework; path = Carthage/Build/iOS/Eureka.framework; sourceTree = ""; }; 83 | CB3F7D901F8BF6E100C856E5 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Example/ExampleUITests/Info.plist; sourceTree = SOURCE_ROOT; }; 84 | CB3F7D911F8BF6E100C856E5 /* CreditCardRowTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CreditCardRowTests.swift; path = Example/ExampleUITests/CreditCardRowTests.swift; sourceTree = SOURCE_ROOT; }; 85 | /* End PBXFileReference section */ 86 | 87 | /* Begin PBXFrameworksBuildPhase section */ 88 | 28F828C91C4B714D00330CF4 /* Frameworks */ = { 89 | isa = PBXFrameworksBuildPhase; 90 | buildActionMask = 2147483647; 91 | files = ( 92 | 8FDE775F1D78C9B200A94698 /* Eureka.framework in Frameworks */, 93 | 8FD114E01D79F685006976C8 /* CreditCardRow.framework in Frameworks */, 94 | ); 95 | runOnlyForDeploymentPostprocessing = 0; 96 | }; 97 | 28F828DD1C4B714D00330CF4 /* Frameworks */ = { 98 | isa = PBXFrameworksBuildPhase; 99 | buildActionMask = 2147483647; 100 | files = ( 101 | ); 102 | runOnlyForDeploymentPostprocessing = 0; 103 | }; 104 | /* End PBXFrameworksBuildPhase section */ 105 | 106 | /* Begin PBXGroup section */ 107 | 287D0A751C4B7B26004566D6 /* Products */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 287D0A7A1C4B7B26004566D6 /* CreditCardRow.framework */, 111 | 287D0A7C1C4B7B26004566D6 /* CreditCardRowTests.xctest */, 112 | ); 113 | name = Products; 114 | sourceTree = ""; 115 | }; 116 | 28F828C31C4B714D00330CF4 = { 117 | isa = PBXGroup; 118 | children = ( 119 | 8FD114B61D79EB6E006976C8 /* Frameworks */, 120 | 28F828CE1C4B714D00330CF4 /* Example */, 121 | CB3F7D7D1F8BF1E300C856E5 /* ExampleUITests */, 122 | 28F828CD1C4B714D00330CF4 /* Products */, 123 | 287D0A741C4B7B26004566D6 /* CreditCardRow.xcodeproj */, 124 | ); 125 | sourceTree = ""; 126 | }; 127 | 28F828CD1C4B714D00330CF4 /* Products */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | 28F828CC1C4B714D00330CF4 /* Example.app */, 131 | 28F828E01C4B714D00330CF4 /* ExampleUITests.xctest */, 132 | ); 133 | name = Products; 134 | sourceTree = ""; 135 | }; 136 | 28F828CE1C4B714D00330CF4 /* Example */ = { 137 | isa = PBXGroup; 138 | children = ( 139 | 28F828D11C4B714D00330CF4 /* ViewController.swift */, 140 | 8F9B3A051D7DB064005F8273 /* CustomCell.xib */, 141 | 8F9B3A071D7DB2C2005F8273 /* MyCreditCardRow.swift */, 142 | 8F9B3A031D7DB02A005F8273 /* Supporting Files */, 143 | ); 144 | path = Example; 145 | sourceTree = ""; 146 | }; 147 | 8F9B3A031D7DB02A005F8273 /* Supporting Files */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | 28F828D31C4B714D00330CF4 /* Main.storyboard */, 151 | 28F828D61C4B714D00330CF4 /* Assets.xcassets */, 152 | 28F828D81C4B714D00330CF4 /* LaunchScreen.storyboard */, 153 | 28F828DB1C4B714D00330CF4 /* Info.plist */, 154 | 28F828CF1C4B714D00330CF4 /* AppDelegate.swift */, 155 | ); 156 | name = "Supporting Files"; 157 | sourceTree = ""; 158 | }; 159 | 8FD114B61D79EB6E006976C8 /* Frameworks */ = { 160 | isa = PBXGroup; 161 | children = ( 162 | 8FDE775E1D78C9B200A94698 /* Eureka.framework */, 163 | ); 164 | name = Frameworks; 165 | sourceTree = ""; 166 | }; 167 | CB3F7D7D1F8BF1E300C856E5 /* ExampleUITests */ = { 168 | isa = PBXGroup; 169 | children = ( 170 | CB3F7D911F8BF6E100C856E5 /* CreditCardRowTests.swift */, 171 | CB3F7D901F8BF6E100C856E5 /* Info.plist */, 172 | ); 173 | path = ExampleUITests; 174 | sourceTree = ""; 175 | }; 176 | /* End PBXGroup section */ 177 | 178 | /* Begin PBXNativeTarget section */ 179 | 28F828CB1C4B714D00330CF4 /* Example */ = { 180 | isa = PBXNativeTarget; 181 | buildConfigurationList = 28F828E91C4B714D00330CF4 /* Build configuration list for PBXNativeTarget "Example" */; 182 | buildPhases = ( 183 | 28F828C81C4B714D00330CF4 /* Sources */, 184 | 28F828C91C4B714D00330CF4 /* Frameworks */, 185 | 28F828CA1C4B714D00330CF4 /* Resources */, 186 | 287D0A811C4B7B55004566D6 /* Embed Frameworks */, 187 | 8FDE77561D78C1AB00A94698 /* Copy Frameworks */, 188 | ); 189 | buildRules = ( 190 | ); 191 | dependencies = ( 192 | 8FD114E31D79F685006976C8 /* PBXTargetDependency */, 193 | ); 194 | name = Example; 195 | productName = Example; 196 | productReference = 28F828CC1C4B714D00330CF4 /* Example.app */; 197 | productType = "com.apple.product-type.application"; 198 | }; 199 | 28F828DF1C4B714D00330CF4 /* ExampleUITests */ = { 200 | isa = PBXNativeTarget; 201 | buildConfigurationList = 28F828EC1C4B714D00330CF4 /* Build configuration list for PBXNativeTarget "ExampleUITests" */; 202 | buildPhases = ( 203 | 28F828DC1C4B714D00330CF4 /* Sources */, 204 | 28F828DD1C4B714D00330CF4 /* Frameworks */, 205 | 28F828DE1C4B714D00330CF4 /* Resources */, 206 | ); 207 | buildRules = ( 208 | ); 209 | dependencies = ( 210 | 28F828E21C4B714D00330CF4 /* PBXTargetDependency */, 211 | ); 212 | name = ExampleUITests; 213 | productName = ExampleUITests; 214 | productReference = 28F828E01C4B714D00330CF4 /* ExampleUITests.xctest */; 215 | productType = "com.apple.product-type.bundle.ui-testing"; 216 | }; 217 | /* End PBXNativeTarget section */ 218 | 219 | /* Begin PBXProject section */ 220 | 28F828C41C4B714D00330CF4 /* Project object */ = { 221 | isa = PBXProject; 222 | attributes = { 223 | LastSwiftUpdateCheck = 0720; 224 | LastUpgradeCheck = 1020; 225 | TargetAttributes = { 226 | 28F828CB1C4B714D00330CF4 = { 227 | CreatedOnToolsVersion = 7.2; 228 | LastSwiftMigration = 1020; 229 | }; 230 | 28F828DF1C4B714D00330CF4 = { 231 | CreatedOnToolsVersion = 7.2; 232 | LastSwiftMigration = 1020; 233 | TestTargetID = 28F828CB1C4B714D00330CF4; 234 | }; 235 | }; 236 | }; 237 | buildConfigurationList = 28F828C71C4B714D00330CF4 /* Build configuration list for PBXProject "Example" */; 238 | compatibilityVersion = "Xcode 3.2"; 239 | developmentRegion = en; 240 | hasScannedForEncodings = 0; 241 | knownRegions = ( 242 | en, 243 | Base, 244 | ); 245 | mainGroup = 28F828C31C4B714D00330CF4; 246 | productRefGroup = 28F828CD1C4B714D00330CF4 /* Products */; 247 | projectDirPath = ""; 248 | projectReferences = ( 249 | { 250 | ProductGroup = 287D0A751C4B7B26004566D6 /* Products */; 251 | ProjectRef = 287D0A741C4B7B26004566D6 /* CreditCardRow.xcodeproj */; 252 | }, 253 | ); 254 | projectRoot = ""; 255 | targets = ( 256 | 28F828CB1C4B714D00330CF4 /* Example */, 257 | 28F828DF1C4B714D00330CF4 /* ExampleUITests */, 258 | ); 259 | }; 260 | /* End PBXProject section */ 261 | 262 | /* Begin PBXReferenceProxy section */ 263 | 287D0A7A1C4B7B26004566D6 /* CreditCardRow.framework */ = { 264 | isa = PBXReferenceProxy; 265 | fileType = wrapper.framework; 266 | path = CreditCardRow.framework; 267 | remoteRef = 287D0A791C4B7B26004566D6 /* PBXContainerItemProxy */; 268 | sourceTree = BUILT_PRODUCTS_DIR; 269 | }; 270 | 287D0A7C1C4B7B26004566D6 /* CreditCardRowTests.xctest */ = { 271 | isa = PBXReferenceProxy; 272 | fileType = wrapper.cfbundle; 273 | path = CreditCardRowTests.xctest; 274 | remoteRef = 287D0A7B1C4B7B26004566D6 /* PBXContainerItemProxy */; 275 | sourceTree = BUILT_PRODUCTS_DIR; 276 | }; 277 | /* End PBXReferenceProxy section */ 278 | 279 | /* Begin PBXResourcesBuildPhase section */ 280 | 28F828CA1C4B714D00330CF4 /* Resources */ = { 281 | isa = PBXResourcesBuildPhase; 282 | buildActionMask = 2147483647; 283 | files = ( 284 | 28F828DA1C4B714D00330CF4 /* LaunchScreen.storyboard in Resources */, 285 | 28F828D71C4B714D00330CF4 /* Assets.xcassets in Resources */, 286 | 8F9B3A061D7DB064005F8273 /* CustomCell.xib in Resources */, 287 | 28F828D51C4B714D00330CF4 /* Main.storyboard in Resources */, 288 | ); 289 | runOnlyForDeploymentPostprocessing = 0; 290 | }; 291 | 28F828DE1C4B714D00330CF4 /* Resources */ = { 292 | isa = PBXResourcesBuildPhase; 293 | buildActionMask = 2147483647; 294 | files = ( 295 | ); 296 | runOnlyForDeploymentPostprocessing = 0; 297 | }; 298 | /* End PBXResourcesBuildPhase section */ 299 | 300 | /* Begin PBXShellScriptBuildPhase section */ 301 | 8FDE77561D78C1AB00A94698 /* Copy Frameworks */ = { 302 | isa = PBXShellScriptBuildPhase; 303 | buildActionMask = 2147483647; 304 | files = ( 305 | ); 306 | inputPaths = ( 307 | "$(SRCROOT)/Carthage/Build/iOS/CreditCardRow.framework", 308 | ); 309 | name = "Copy Frameworks"; 310 | outputPaths = ( 311 | ); 312 | runOnlyForDeploymentPostprocessing = 0; 313 | shellPath = /bin/sh; 314 | shellScript = "#/usr/local/bin/carthage copy-frameworks"; 315 | }; 316 | /* End PBXShellScriptBuildPhase section */ 317 | 318 | /* Begin PBXSourcesBuildPhase section */ 319 | 28F828C81C4B714D00330CF4 /* Sources */ = { 320 | isa = PBXSourcesBuildPhase; 321 | buildActionMask = 2147483647; 322 | files = ( 323 | 28F828D21C4B714D00330CF4 /* ViewController.swift in Sources */, 324 | 28F828D01C4B714D00330CF4 /* AppDelegate.swift in Sources */, 325 | 8F9B3A081D7DB2C2005F8273 /* MyCreditCardRow.swift in Sources */, 326 | ); 327 | runOnlyForDeploymentPostprocessing = 0; 328 | }; 329 | 28F828DC1C4B714D00330CF4 /* Sources */ = { 330 | isa = PBXSourcesBuildPhase; 331 | buildActionMask = 2147483647; 332 | files = ( 333 | CB3F7D931F8BF6E100C856E5 /* CreditCardRowTests.swift in Sources */, 334 | ); 335 | runOnlyForDeploymentPostprocessing = 0; 336 | }; 337 | /* End PBXSourcesBuildPhase section */ 338 | 339 | /* Begin PBXTargetDependency section */ 340 | 28F828E21C4B714D00330CF4 /* PBXTargetDependency */ = { 341 | isa = PBXTargetDependency; 342 | target = 28F828CB1C4B714D00330CF4 /* Example */; 343 | targetProxy = 28F828E11C4B714D00330CF4 /* PBXContainerItemProxy */; 344 | }; 345 | 8FD114E31D79F685006976C8 /* PBXTargetDependency */ = { 346 | isa = PBXTargetDependency; 347 | name = CreditCardRow; 348 | targetProxy = 8FD114E21D79F685006976C8 /* PBXContainerItemProxy */; 349 | }; 350 | /* End PBXTargetDependency section */ 351 | 352 | /* Begin PBXVariantGroup section */ 353 | 28F828D31C4B714D00330CF4 /* Main.storyboard */ = { 354 | isa = PBXVariantGroup; 355 | children = ( 356 | 28F828D41C4B714D00330CF4 /* Base */, 357 | ); 358 | name = Main.storyboard; 359 | path = Example; 360 | sourceTree = ""; 361 | }; 362 | 28F828D81C4B714D00330CF4 /* LaunchScreen.storyboard */ = { 363 | isa = PBXVariantGroup; 364 | children = ( 365 | 28F828D91C4B714D00330CF4 /* Base */, 366 | ); 367 | name = LaunchScreen.storyboard; 368 | path = Example; 369 | sourceTree = ""; 370 | }; 371 | /* End PBXVariantGroup section */ 372 | 373 | /* Begin XCBuildConfiguration section */ 374 | 28F828E71C4B714D00330CF4 /* Debug */ = { 375 | isa = XCBuildConfiguration; 376 | buildSettings = { 377 | ALWAYS_SEARCH_USER_PATHS = NO; 378 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 379 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 380 | CLANG_CXX_LIBRARY = "libc++"; 381 | CLANG_ENABLE_MODULES = YES; 382 | CLANG_ENABLE_OBJC_ARC = YES; 383 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 384 | CLANG_WARN_BOOL_CONVERSION = YES; 385 | CLANG_WARN_COMMA = YES; 386 | CLANG_WARN_CONSTANT_CONVERSION = YES; 387 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 388 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 389 | CLANG_WARN_EMPTY_BODY = YES; 390 | CLANG_WARN_ENUM_CONVERSION = YES; 391 | CLANG_WARN_INFINITE_RECURSION = YES; 392 | CLANG_WARN_INT_CONVERSION = YES; 393 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 394 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 395 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 396 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 397 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 398 | CLANG_WARN_STRICT_PROTOTYPES = YES; 399 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 400 | CLANG_WARN_UNREACHABLE_CODE = YES; 401 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 402 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 403 | COPY_PHASE_STRIP = NO; 404 | DEBUG_INFORMATION_FORMAT = dwarf; 405 | ENABLE_STRICT_OBJC_MSGSEND = YES; 406 | ENABLE_TESTABILITY = YES; 407 | GCC_C_LANGUAGE_STANDARD = gnu99; 408 | GCC_DYNAMIC_NO_PIC = NO; 409 | GCC_NO_COMMON_BLOCKS = YES; 410 | GCC_OPTIMIZATION_LEVEL = 0; 411 | GCC_PREPROCESSOR_DEFINITIONS = ( 412 | "DEBUG=1", 413 | "$(inherited)", 414 | ); 415 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 416 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 417 | GCC_WARN_UNDECLARED_SELECTOR = YES; 418 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 419 | GCC_WARN_UNUSED_FUNCTION = YES; 420 | GCC_WARN_UNUSED_VARIABLE = YES; 421 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 422 | MTL_ENABLE_DEBUG_INFO = YES; 423 | ONLY_ACTIVE_ARCH = YES; 424 | SDKROOT = iphoneos; 425 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 426 | }; 427 | name = Debug; 428 | }; 429 | 28F828E81C4B714D00330CF4 /* Release */ = { 430 | isa = XCBuildConfiguration; 431 | buildSettings = { 432 | ALWAYS_SEARCH_USER_PATHS = NO; 433 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 434 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 435 | CLANG_CXX_LIBRARY = "libc++"; 436 | CLANG_ENABLE_MODULES = YES; 437 | CLANG_ENABLE_OBJC_ARC = YES; 438 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 439 | CLANG_WARN_BOOL_CONVERSION = YES; 440 | CLANG_WARN_COMMA = YES; 441 | CLANG_WARN_CONSTANT_CONVERSION = YES; 442 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 443 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 444 | CLANG_WARN_EMPTY_BODY = YES; 445 | CLANG_WARN_ENUM_CONVERSION = YES; 446 | CLANG_WARN_INFINITE_RECURSION = YES; 447 | CLANG_WARN_INT_CONVERSION = YES; 448 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 449 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 450 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 451 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 452 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 453 | CLANG_WARN_STRICT_PROTOTYPES = YES; 454 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 455 | CLANG_WARN_UNREACHABLE_CODE = YES; 456 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 457 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 458 | COPY_PHASE_STRIP = NO; 459 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 460 | ENABLE_NS_ASSERTIONS = NO; 461 | ENABLE_STRICT_OBJC_MSGSEND = YES; 462 | GCC_C_LANGUAGE_STANDARD = gnu99; 463 | GCC_NO_COMMON_BLOCKS = YES; 464 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 465 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 466 | GCC_WARN_UNDECLARED_SELECTOR = YES; 467 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 468 | GCC_WARN_UNUSED_FUNCTION = YES; 469 | GCC_WARN_UNUSED_VARIABLE = YES; 470 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 471 | MTL_ENABLE_DEBUG_INFO = NO; 472 | SDKROOT = iphoneos; 473 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 474 | VALIDATE_PRODUCT = YES; 475 | }; 476 | name = Release; 477 | }; 478 | 28F828EA1C4B714D00330CF4 /* Debug */ = { 479 | isa = XCBuildConfiguration; 480 | buildSettings = { 481 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 482 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 483 | DEVELOPMENT_TEAM = ""; 484 | FRAMEWORK_SEARCH_PATHS = ( 485 | "$(inherited)", 486 | "$(PROJECT_DIR)/Frameworks", 487 | "$(PROJECT_DIR)/Carthage/Build/iOS/", 488 | ); 489 | INFOPLIST_FILE = "$(SRCROOT)/Example/Example/Info.plist"; 490 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 491 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 492 | PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.Example; 493 | PRODUCT_NAME = "$(TARGET_NAME)"; 494 | SWIFT_VERSION = 5.0; 495 | }; 496 | name = Debug; 497 | }; 498 | 28F828EB1C4B714D00330CF4 /* Release */ = { 499 | isa = XCBuildConfiguration; 500 | buildSettings = { 501 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 502 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 503 | DEVELOPMENT_TEAM = ""; 504 | FRAMEWORK_SEARCH_PATHS = ( 505 | "$(inherited)", 506 | "$(PROJECT_DIR)/Frameworks", 507 | "$(PROJECT_DIR)/Carthage/Build/iOS/", 508 | ); 509 | INFOPLIST_FILE = "$(SRCROOT)/Example/Example/Info.plist"; 510 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 511 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 512 | PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.Example; 513 | PRODUCT_NAME = "$(TARGET_NAME)"; 514 | SWIFT_VERSION = 5.0; 515 | }; 516 | name = Release; 517 | }; 518 | 28F828ED1C4B714D00330CF4 /* Debug */ = { 519 | isa = XCBuildConfiguration; 520 | buildSettings = { 521 | CLANG_ENABLE_MODULES = YES; 522 | INFOPLIST_FILE = Example/ExampleUITests/Info.plist; 523 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 524 | PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.ExampleUITests; 525 | PRODUCT_NAME = "$(TARGET_NAME)"; 526 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 527 | SWIFT_VERSION = 5.0; 528 | TEST_TARGET_NAME = Example; 529 | USES_XCTRUNNER = YES; 530 | }; 531 | name = Debug; 532 | }; 533 | 28F828EE1C4B714D00330CF4 /* Release */ = { 534 | isa = XCBuildConfiguration; 535 | buildSettings = { 536 | CLANG_ENABLE_MODULES = YES; 537 | INFOPLIST_FILE = Example/ExampleUITests/Info.plist; 538 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 539 | PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.ExampleUITests; 540 | PRODUCT_NAME = "$(TARGET_NAME)"; 541 | SWIFT_VERSION = 5.0; 542 | TEST_TARGET_NAME = Example; 543 | USES_XCTRUNNER = YES; 544 | }; 545 | name = Release; 546 | }; 547 | /* End XCBuildConfiguration section */ 548 | 549 | /* Begin XCConfigurationList section */ 550 | 28F828C71C4B714D00330CF4 /* Build configuration list for PBXProject "Example" */ = { 551 | isa = XCConfigurationList; 552 | buildConfigurations = ( 553 | 28F828E71C4B714D00330CF4 /* Debug */, 554 | 28F828E81C4B714D00330CF4 /* Release */, 555 | ); 556 | defaultConfigurationIsVisible = 0; 557 | defaultConfigurationName = Release; 558 | }; 559 | 28F828E91C4B714D00330CF4 /* Build configuration list for PBXNativeTarget "Example" */ = { 560 | isa = XCConfigurationList; 561 | buildConfigurations = ( 562 | 28F828EA1C4B714D00330CF4 /* Debug */, 563 | 28F828EB1C4B714D00330CF4 /* Release */, 564 | ); 565 | defaultConfigurationIsVisible = 0; 566 | defaultConfigurationName = Release; 567 | }; 568 | 28F828EC1C4B714D00330CF4 /* Build configuration list for PBXNativeTarget "ExampleUITests" */ = { 569 | isa = XCConfigurationList; 570 | buildConfigurations = ( 571 | 28F828ED1C4B714D00330CF4 /* Debug */, 572 | 28F828EE1C4B714D00330CF4 /* Release */, 573 | ); 574 | defaultConfigurationIsVisible = 0; 575 | defaultConfigurationName = Release; 576 | }; 577 | /* End XCConfigurationList section */ 578 | }; 579 | rootObject = 28F828C41C4B714D00330CF4 /* Project object */; 580 | } 581 | -------------------------------------------------------------------------------- /Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/Example/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Example 4 | // 5 | // Copyright © 2016 Xmartlabs SRL. All rights reserved. 6 | // 7 | 8 | import UIKit 9 | 10 | @UIApplicationMain 11 | class AppDelegate: UIResponder, UIApplicationDelegate { 12 | 13 | var window: UIWindow? 14 | 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 17 | // Override point for customization after application launch. 18 | return true 19 | } 20 | 21 | func applicationWillResignActive(_ application: UIApplication) { 22 | // 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. 23 | // 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. 24 | } 25 | 26 | func applicationDidEnterBackground(_ application: UIApplication) { 27 | // 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. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | func applicationWillEnterForeground(_ application: UIApplication) { 32 | // 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. 33 | } 34 | 35 | func applicationDidBecomeActive(_ application: UIApplication) { 36 | // 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. 37 | } 38 | 39 | func applicationWillTerminate(_ application: UIApplication) { 40 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Example/Example/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Example/Example/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Example/CustomCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Example/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 | CreditCardRow 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Example/Example/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Example 4 | // 5 | // Copyright © 2016 Xmartlabs SRL. All rights reserved. 6 | // 7 | 8 | import UIKit 9 | import Eureka 10 | import CreditCardRow 11 | 12 | class ViewController: FormViewController { 13 | 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | 17 | // CreditCardRow.defaultRowInitializer = { 18 | // $0.cellProvider = CellProvider(nibName: "CustomCell", bundle: nil) 19 | // } 20 | 21 | // Append the default CreditCardRow and my custom MyCreditCardRow 22 | form +++ Section() 23 | <<< CreditCardRow() { 24 | $0.numberSeparator = "-" 25 | $0.expirationSeparator = "-" 26 | $0.maxCreditCardNumberLength = 16 27 | $0.maxCVVLength = 3 28 | } 29 | 30 | +++ Section() 31 | <<< MyCreditCardRow() { 32 | $0.numberSeparator = " - " 33 | } 34 | .cellSetup({ (cell, row) in 35 | cell.height = { 50 } 36 | cell.numberField.padding = 8 37 | cell.numberField.textAlignment = .center 38 | cell.numberField.textColor = .blue 39 | cell.backgroundColor = UIColor(red: 0.83, green: 0.96, blue: 0.83, alpha: 1) 40 | }) 41 | 42 | } 43 | } 44 | 45 | -------------------------------------------------------------------------------- /Example/ExampleUITests/CreditCardRowTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CreditCardRowTests.swift 3 | // CreditCardRowTests 4 | // 5 | // Copyright © 2016 Xmartlabs SRL. All rights reserved. 6 | // 7 | 8 | import XCTest 9 | 10 | class CreditCardRowTests: XCTestCase { 11 | 12 | override func setUp() { 13 | super.setUp() 14 | // Put setup code here. This method is called before the invocation of each test method in the class. 15 | } 16 | 17 | override func tearDown() { 18 | // Put teardown code here. This method is called after the invocation of each test method in the class. 19 | super.tearDown() 20 | } 21 | 22 | func testExample() { 23 | // This is an example of a functional test case. 24 | // Use XCTAssert and related functions to verify your tests produce the correct results. 25 | } 26 | 27 | func testPerformanceExample() { 28 | // This is an example of a performance test case. 29 | self.measure { 30 | // Put the code you want to measure the time of here. 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Example/ExampleUITests/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/MyCreditCardRow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CustomRow.swift 3 | // Example 4 | // 5 | // Created by Mathias Claassen on 9/5/16. 6 | // 7 | // 8 | 9 | import Foundation 10 | import CreditCardRow 11 | import Eureka 12 | 13 | final class MyCreditCardRow: _CreditCardRow, RowType { 14 | required init(tag: String?) { 15 | super.init(tag: tag) 16 | cellProvider = CellProvider(nibName: "CustomCell", bundle: Bundle.main) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Xmartlabs SRL 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 | -------------------------------------------------------------------------------- /Media/CreditCardRow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EurekaCommunity/CreditCardRow/9d1b7c186f1c554a6693b9c581858e130884b6b7/Media/CreditCardRow.gif -------------------------------------------------------------------------------- /Media/CreditCardRowCustom.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EurekaCommunity/CreditCardRow/9d1b7c186f1c554a6693b9c581858e130884b6b7/Media/CreditCardRowCustom.gif -------------------------------------------------------------------------------- /Media/row-parameters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EurekaCommunity/CreditCardRow/9d1b7c186f1c554a6693b9c581858e130884b6b7/Media/row-parameters.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CreditCardRow 2 | 3 |

4 | Build status 5 | Platform iOS 6 | Swift 2 compatible 7 | Carthage compatible 8 | CocoaPods compatible 9 | License: MIT 10 |

11 | 12 | By [Xmartlabs SRL](http://xmartlabs.com). 13 | 14 | ## Contents 15 | * [Introduction](#introduction) 16 | * [Usage](#usage) 17 | * [Requirements](#requirements) 18 | * [Getting involved](#getting-involved) 19 | * [Examples](#examples) 20 | * [Installation](#installation) 21 | * [Customization](#customization) 22 | * [CreditCardRow parameters](#creditcardrow-parameters) 23 | * [Creating custom nib file](#custom-nib) 24 | * [Extending or overriding CreditCardCell functionality](#overriding) 25 | * [Roadmap](#roadmap) 26 | 27 | ## Introduction 28 | 29 | `CreditCardRow` is a custom row for Eureka in which the user will be able to input a credit card, its expiration date and the CVV/CVC value. It has a default UI design but that [can be easily changed](#customization) to fit (almost) any other design. 30 | 31 | 32 | 33 | ## Usage 34 | 35 | ```swift 36 | import Eureka 37 | import CreditCardRow 38 | 39 | class ViewController: FormViewController { 40 | 41 | override func viewDidLoad() { 42 | super.viewDidLoad() 43 | 44 | 45 | // Append the default CreditCardRow and my custom MyCreditCardRow 46 | form +++ Section() 47 | <<< CreditCardRow() 48 | } 49 | } 50 | ``` 51 | 52 | ## Requirements 53 | 54 | * iOS 9.3+ 55 | * Xcode 10.2+ 56 | 57 | ## Getting involved 58 | 59 | * If you **want to contribute** please feel free to **submit pull requests**. 60 | * If you **have a feature request** please **open an issue**. 61 | * If you **found a bug** or **need help** please **check older issues**. 62 | 63 | Before contribute check the [CONTRIBUTING](https://github.com/xmartlabs/CreditCardRow/blob/master/CONTRIBUTING.md) file for more info. 64 | 65 | If you use **CreditCardRow** in your app We would love to hear about it! Drop us a line on [twitter](https://twitter.com/xmartlabs). 66 | 67 | ## Examples 68 | 69 | Follow these steps to run Example project: 70 | * Clone CreditCardRow repository 71 | * Open terminal in the downloaded folder and run carthage update 72 | * Open CreditCardRow workspace 73 | * Run the *Example* project. 74 | 75 | ## Installation 76 | 77 | #### CocoaPods 78 | 79 | [CocoaPods](https://cocoapods.org/) is a dependency manager for Cocoa projects. 80 | 81 | To install CreditCardRow, simply add the following line to your Podfile: 82 | 83 | ```ruby 84 | pod 'CreditCardRow', '~> 3.2' 85 | ``` 86 | 87 | #### Carthage 88 | 89 | [Carthage](https://github.com/Carthage/Carthage) is a simple, decentralized dependency manager for Cocoa. 90 | 91 | To install CreditCardRow, simply add the following line to your Cartfile: 92 | 93 | ```ogdl 94 | github "EurekaCommunity/CreditCardRow" ~> 3.0 95 | ``` 96 | 97 | 98 | ## Customization 99 | 100 | A custom row is not worth much if it is not customisable. Therefore this row aims to be pretty customisable. Ideally you should be able to use all the logic implemented here with a completely different design. You should also be able to easily switch some basic behaviour. 101 | 102 | For basic styling like fonts, colors, margins, separators you should use `cellSetup` and `cellUpdate`. For more complex stuff there are other ways to create what you want. 103 | 104 | > CreditCardRow includes row navigation so that the user can navigate from one field to the next by tapping a button in the accessoryView of the cell. If you change the order of the text fields then you should also [override the row navigation functionality](#overriding). 105 | 106 | ### CreditCardRow parameters 107 | 108 | `CreditCardRow` has the following variables that can be used/changed: 109 | 110 | * `var numberSeparator: String = " "`: Separator for the credit card number. Supports multi-character strings like " - " for example. 111 | * `var expirationSeparator: Character = "/"`: Separator used between month and year numbers in expiration field. 112 | * `var maxCVVLength: Int = 4`: Maximum length for CVV/CVC field 113 | * `var maxCreditCardNumberLength = 19`: Maximum length for Credit Card number. Credit Card length can be up to 19 after ISO 7812-1. 6 digits IIN, 12 account digits and a check digit. 114 | 115 | For example you can do this: 116 | 117 | ```swift 118 | <<< CreditCardRow() { 119 | $0.numberSeparator = "-" 120 | $0.expirationSeparator = "-" 121 | $0.maxCreditCardNumberLength = 16 122 | $0.maxCVVLength = 3 123 | } 124 | ``` 125 | 126 | 127 | 128 | 129 | ### CreditCardCell parameters: 130 | 131 | The `CreditCardCell` has the following variables (all of them are outlets and can be connected from a nib file): 132 | 133 | * `var horizontalSeparator: UIView?`: Horizontal separator between number field and expiration and CVV fields in original cell 134 | * `var verticalSeparator: UIView?`: Vertical separator between expiration and CVV fields in original cell 135 | * `var numberField: PaddedTextField!`: Text field for the credit card number 136 | * `var expirationField: PaddedTextField?`: Text field for the expiration date of the credit card. This is an optional variable. You could implement a cell without the `expirationField` 137 | * `var cvvField: PaddedTextField?`: Text field for the CVV value. This text field is also optional. 138 | 139 | > PaddedTextField is a UITextField subclass that implements a padding around the text rect of the UITextField. 140 | 141 | `horizontalSeparator` and `verticalSeparator` depend on the default design. You will probably not use them if you create your own design. Also, as `expirationField` and `cvvField` are optional you could create a cell that just contains the credit card number like the following (you can find it in the example project): 142 | 143 | 144 | 145 | ### Creating custom nib file 146 | 147 | You might want to follow your own design. To accomplish this you should follow these steps: 148 | 149 | * Create a user interface xib file and edit it with Xcode's Interface Builder. You should add a simple `UITableViewCell` and say that its class is a `CreditCardCell`. Make sure that the module of that class appears as `CreditCardRow`. 150 | * Add an UITextField for the credit card's number. If you also want then you can add text fields for the expiration date and CVV/CVC value of the credit card. 151 | * Connect these UITextField's to the corresponding outlets in the CreditCardCell.swift file 152 | * Customise how the internal navigation works for these text fields (if you have changed the order of the fields.) 153 | * Specify that you want to use the newly created nib file. You can do this in two ways: 154 | * Using RowDefaults: use this if you want to use only this custom CreditCardRow in your app. 155 | 156 | ```swift 157 | CreditCardRow.defaultRowInitializer = { 158 | $0.cellProvider = CellProvider(nibName: "CustomCell", bundle: nil) 159 | } 160 | ``` 161 | 162 | * Or create a custom row subclassing `_CreditCardRow`: 163 | 164 | ```swift 165 | final class MyCreditCardRow: _CreditCardRow, RowType { 166 | required init(tag: String?) { 167 | super.init(tag: tag) 168 | cellProvider = CellProvider(nibName: "CustomCell", bundle: nil) 169 | } 170 | } 171 | ``` 172 | 173 | ### Extending or overriding CreditCardCell functionality 174 | 175 | Sometimes it is not enough to create a custom nib file; you also need to subclass and change some functionality. An example of this is if you change the order in which the text fields appear to the user or you remove the `expirationField` or the `cvvField` and you want to change the row navigation. In that case you should start by creating a class that subclasses `CreditCardCell` and that overrides `inputAccessoryView`: 176 | 177 | ```swift 178 | class MyCreditCardCell: CreditCardCell { 179 | override var inputAccessoryView: UIView? { 180 | // customize the accessoryView. Have a look at its superclass's implementation 181 | return super.inputAccessoryView 182 | } 183 | } 184 | ``` 185 | 186 | You should be able to change any behaviour by overriding some method or variable. 187 | 188 | To use this `MyCreditCardCell`, you will have to specify in your nib file that you are using this class and you must change the `cellProvider` of `CreditCardRow` to use your custom nib file (as you should have already done if you read the previous section). 189 | 190 | ## Author 191 | 192 | * [Mathias Claassen](https://github.com/mats-claassen) ([@mClaassen26](https://twitter.com/mClaassen26)) 193 | 194 | ## What is on the roadmap? 195 | 196 | What could be added to CreditCardRow: 197 | 198 | * Implement some Eureka Validation 199 | * Add SwiftLuhn validation 200 | 201 | # Change Log 202 | 203 | This can be found in the [CHANGELOG.md](CHANGELOG.md) file. 204 | -------------------------------------------------------------------------------- /Sources/CreditCardCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // iOS.swift 3 | // CreditCardRow 4 | // 5 | // Copyright © 2016 Xmartlabs SRL. All rights reserved. 6 | // 7 | 8 | import Foundation 9 | import Eureka 10 | 11 | /** 12 | * Struct holding the value for a CreditCardRow 13 | */ 14 | public struct CreditCardInfo : Equatable { 15 | public var creditCardNumber : String? 16 | public var expiration : String? 17 | public var cvv : String? 18 | 19 | public init() { } 20 | } 21 | 22 | public func ==(lhs: CreditCardInfo, rhs: CreditCardInfo) -> Bool { 23 | return (lhs.creditCardNumber == rhs.creditCardNumber && lhs.expiration == rhs.expiration && lhs.cvv == rhs.cvv) 24 | } 25 | 26 | open class CreditCardCell: Cell, UITextFieldDelegate, CellType { 27 | 28 | /// Horizontal separator between number field and expiration and CVV fields in original cell 29 | @IBOutlet public weak var horizontalSeparator: UIView? 30 | 31 | /// Vertical separator between expiration and CVV fields in original cell 32 | @IBOutlet public weak var verticalSeparator: UIView? 33 | 34 | /// Text field for the credit card number. 35 | @IBOutlet public weak var numberField: PaddedTextField! 36 | 37 | /// Text field for the expiration date of the credit card 38 | @IBOutlet public weak var expirationField: PaddedTextField? 39 | 40 | /// Text field for the CVV value 41 | @IBOutlet public weak var cvvField: PaddedTextField? 42 | 43 | // Variables used to save temporary information about number text field 44 | fileprivate var previousTextFieldContent: String? 45 | fileprivate var previousSelection: UITextRange? 46 | 47 | required public init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { 48 | super.init(style: style, reuseIdentifier: reuseIdentifier) 49 | } 50 | 51 | required public init?(coder aDecoder: NSCoder) { 52 | super.init(coder: aDecoder) 53 | } 54 | 55 | open override func setup() { 56 | super.setup() 57 | height = { 56 * 2 } 58 | selectionStyle = .none 59 | numberField.padding = 16.0 60 | expirationField?.padding = 16.0 61 | cvvField?.padding = 18.0 62 | 63 | horizontalSeparator?.backgroundColor = .gray 64 | verticalSeparator?.backgroundColor = .gray 65 | 66 | for field in [numberField, expirationField, cvvField] { 67 | field?.autocorrectionType = .no 68 | field?.autocapitalizationType = .none 69 | field?.keyboardType = .numberPad 70 | field?.font = .systemFont(ofSize: 24) 71 | field?.minimumFontSize = 14.0 72 | field?.addTarget(self, action: #selector(CreditCardCell.textFieldEditingChanged(_:)), for: .editingChanged) 73 | field?.delegate = self 74 | } 75 | 76 | cvvField?.isSecureTextEntry = true 77 | } 78 | 79 | open override func update() { 80 | super.update() 81 | textLabel?.text = nil 82 | 83 | contentView.layer.borderWidth = 1.0 84 | contentView.layer.borderColor = UIColor.gray.cgColor 85 | 86 | numberField.text = row.value?.creditCardNumber 87 | reformatAsCardNumber(numberField) 88 | numberField.placeholder = NSLocalizedString("Card Number", comment: "Card Number placeholder") 89 | 90 | if let cvvField = cvvField { 91 | cvvField.text = row.value?.cvv 92 | reformatAsCVV(cvvField) 93 | cvvField.placeholder = NSLocalizedString("Card CVV", comment: "Card CVV placeholder") 94 | } 95 | 96 | if let expirationField = expirationField { 97 | expirationField.text = row.value?.expiration 98 | reformatAsExpiration(expirationField) 99 | expirationField.placeholder = NSLocalizedString("MM\(ccrow.expirationSeparator)YY", comment: "Card Expiration placeholder") 100 | } 101 | } 102 | 103 | /** 104 | Update row.value for a certain textfield. 105 | 106 | - parameter textField: The textfield from which to obtain a value 107 | */ 108 | func updateValuesForTextField(_ textField: UITextField) { 109 | switch(textField){ 110 | case numberField: 111 | row.value?.creditCardNumber = textField.text?.replacingOccurrences(of: ccrow.numberSeparator, with: "", options: .literal, range: nil) 112 | case expirationField!: 113 | row.value?.expiration = textField.text 114 | case cvvField!: 115 | row.value?.cvv = textField.text 116 | default: break 117 | } 118 | } 119 | 120 | /// Strong-typed row 121 | fileprivate var ccrow: _CreditCardRow { 122 | return row as! _CreditCardRow 123 | } 124 | 125 | override open func cellCanBecomeFirstResponder() -> Bool { 126 | return !row.isDisabled 127 | } 128 | 129 | open override func cellBecomeFirstResponder(withDirection direction: Direction) -> Bool { 130 | switch direction { 131 | case .up: 132 | return cvvField?.becomeFirstResponder() ?? expirationField?.becomeFirstResponder() ?? numberField.becomeFirstResponder() 133 | case .down: 134 | return numberField.becomeFirstResponder() 135 | } 136 | } 137 | 138 | //MARK: Navigation 139 | 140 | 141 | override open var inputAccessoryView: UIView? { 142 | // get the default accessory view and override some methods for internal navigation 143 | if let v = formViewController()?.inputAccessoryView(for: row) as? NavigationAccessoryView{ 144 | if numberField.isFirstResponder { 145 | v.nextButton.isEnabled = true 146 | v.nextButton.target = self 147 | v.nextButton.action = #selector(CreditCardCell.internalNavigationAction(_:)) 148 | return v 149 | } 150 | else if expirationField?.isFirstResponder == true { 151 | v.previousButton.target = self 152 | v.previousButton.action = #selector(CreditCardCell.internalNavigationAction(_:)) 153 | v.nextButton.target = self 154 | v.nextButton.action = #selector(CreditCardCell.internalNavigationAction(_:)) 155 | v.previousButton.isEnabled = true 156 | v.nextButton.isEnabled = true 157 | return v 158 | } 159 | else if cvvField?.isFirstResponder == true { 160 | v.previousButton.isEnabled = true 161 | v.previousButton.target = self 162 | v.previousButton.action = #selector(CreditCardCell.internalNavigationAction(_:)) 163 | return v 164 | } 165 | return v 166 | } 167 | return super.inputAccessoryView 168 | } 169 | 170 | /// Internal function that handles the tap of the row navigation buttons 171 | @objc func internalNavigationAction(_ sender: UIBarButtonItem) { 172 | guard let inputAccessoryView = inputAccessoryView as? NavigationAccessoryView else { return } 173 | 174 | if numberField.isFirstResponder { 175 | expirationField?.becomeFirstResponder() 176 | } 177 | else if expirationField?.isFirstResponder == true { 178 | _ = (sender == inputAccessoryView.previousButton ? numberField.becomeFirstResponder() : cvvField?.becomeFirstResponder()) 179 | } 180 | else if cvvField?.isFirstResponder == true { 181 | expirationField?.becomeFirstResponder() 182 | } 183 | } 184 | 185 | //MARK: UITextFieldDelegate 186 | @objc open func textFieldEditingChanged(_ textField: UITextField) { 187 | updateValuesForTextField(textField) 188 | switch textField { 189 | case numberField: 190 | reformatAsCardNumber(textField) 191 | case expirationField!: 192 | reformatAsExpiration(textField) 193 | case cvvField!: 194 | reformatAsCVV(textField) 195 | default: break 196 | } 197 | } 198 | 199 | @objc open func textFieldDidEndEditing(_ textField: UITextField) { 200 | updateValuesForTextField(textField) 201 | } 202 | 203 | open func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { 204 | // Save textField's current state before performing the change, in case 205 | // reformatAsCardNumber wants to revert it 206 | switch textField { 207 | case numberField: 208 | previousTextFieldContent = textField.text 209 | previousSelection = textField.selectedTextRange 210 | default: 211 | break 212 | } 213 | return true 214 | } 215 | 216 | //MARK: Card number formatting 217 | 218 | open func reformatAsCardNumber(_ textField: UITextField) { 219 | // In order to make the cursor end up positioned correctly, we need to 220 | // explicitly reposition it after we inject spaces into the text. 221 | // targetCursorPosition keeps track of where the cursor needs to end up as 222 | // we modify the string, and at the end we set the cursor position to it. 223 | guard let selectedRange = textField.selectedTextRange, let textString = textField.text else { return } 224 | var targetCursorPosition = textField.offset(from: textField.beginningOfDocument, to: selectedRange.start) 225 | 226 | let cardNumberWithoutSpaces = removeNonDigits(textString, cursorPosition: &targetCursorPosition) 227 | 228 | if cardNumberWithoutSpaces.count > ccrow.maxCreditCardNumberLength { 229 | // If the user is trying to enter more than maxCreditCardNumberLength digits, we prevent 230 | // their change, leaving the text field in its previous state. 231 | textField.text = previousTextFieldContent 232 | textField.selectedTextRange = previousSelection 233 | return 234 | } 235 | 236 | let cardNumberWithSpaces = insertSpacesEveryFourDigits(cardNumberWithoutSpaces, cursorPosition: &targetCursorPosition) 237 | 238 | // update text and cursor appropiately 239 | textField.text = cardNumberWithSpaces 240 | if let targetPosition = textField.position(from: textField.beginningOfDocument, offset: targetCursorPosition) { 241 | textField.selectedTextRange = textField.textRange(from: targetPosition, to: targetPosition) 242 | } 243 | } 244 | 245 | /** 246 | Removes non-digits from the string, decrementing `cursorPosition` as 247 | appropriate so that, for instance, if we pass in `@"1111 1123 1111"` 248 | and a cursor position of `8`, the cursor position will be changed to 249 | `7` (keeping it between the '2' and the '3' after the spaces are removed). 250 | */ 251 | 252 | open func removeNonDigits(_ string: String, cursorPosition: inout Int) -> String { 253 | let originalCursorPosition = cursorPosition 254 | var digitsOnlyString = "" 255 | for i in 0.. String { 279 | var stringWithAddedSpaces = "" 280 | let cursorPositionInSpacelessString = cursorPosition 281 | for i in 0..0) && ((i % 4) == 0)) { 283 | stringWithAddedSpaces += ccrow.numberSeparator 284 | if (i < cursorPositionInSpacelessString) { 285 | cursorPosition += ccrow.numberSeparator.count 286 | } 287 | } 288 | stringWithAddedSpaces.append(string[string.index(string.startIndex, offsetBy: i)]) 289 | } 290 | 291 | return stringWithAddedSpaces 292 | } 293 | 294 | //MARK: Expiration date formatting 295 | open func reformatAsExpiration(_ textField: UITextField) { 296 | guard let string = textField.text else { return } 297 | let expirationString = String(ccrow.expirationSeparator) 298 | let cleanString = string.replacingOccurrences(of: expirationString, with: "", options: .literal, range: nil) 299 | if cleanString.count >= 3 { 300 | let monthString = cleanString[Range(0...1)] 301 | var yearString: String 302 | if cleanString.count == 3 { 303 | yearString = cleanString[2] 304 | } else { 305 | yearString = cleanString[Range(2...3)] 306 | } 307 | textField.text = monthString + expirationString + yearString 308 | } else { 309 | textField.text = cleanString 310 | } 311 | } 312 | 313 | //MARK: CVV formatting 314 | open func reformatAsCVV(_ textField: UITextField) { 315 | guard let string = textField.text else { return } 316 | if string.count > ccrow.maxCVVLength { 317 | textField.text = string[0.. 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /Sources/CreditCardRow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CreditCardRow.swift 3 | // CreditCardRow 4 | // 5 | // Created by Mathias Claassen on 9/1/16. 6 | // 7 | // 8 | 9 | import Eureka 10 | 11 | /// Credit card row for Eureka. If you want to change the nib file for this cell then you should subclass _CreditCardRow 12 | open class _CreditCardRow : Row { 13 | 14 | /// Separator for the credit card number. Defaults to a whitespace. Emojis currently not supported. 15 | public var numberSeparator: String = " " 16 | 17 | /// Separator used between month and year numbers in expiration field 18 | public var expirationSeparator: Character = "/" 19 | 20 | /// Maximum length for CVV number 21 | public var maxCVVLength: Int = 4 22 | 23 | /// Maximum length for Credit Card number. Credit Card length can be up to 19 after ISO 7812-1. 6 digits IIN, 12 account digits and a check digit. 24 | public var maxCreditCardNumberLength = 19 25 | 26 | required public init(tag: String?) { 27 | super.init(tag: tag) 28 | displayValueFor = nil 29 | value = CreditCardInfo() 30 | } 31 | } 32 | 33 | /// Credit card row for Eureka. 34 | public final class CreditCardRow : _CreditCardRow, RowType { 35 | 36 | required public init(tag: String?) { 37 | super.init(tag: tag) 38 | 39 | // load correct bundle for cell nib file 40 | var bundle = Bundle(for: CreditCardRow.self) 41 | let bundleURL = bundle.url(forResource: "CreditCardRow", withExtension: "bundle") 42 | if let bundleURL = bundleURL { 43 | // Cocoapods 44 | bundle = Bundle(url: bundleURL)! 45 | } 46 | cellProvider = CellProvider(nibName: "CreditCardCell", bundle: bundle) 47 | } 48 | 49 | 50 | } 51 | -------------------------------------------------------------------------------- /Sources/PaddedTextField.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PaddedTextField.swift 3 | // CreditCardRow 4 | // 5 | // Created by Mathias Claassen on 9/1/16. 6 | // 7 | // 8 | 9 | import UIKit 10 | 11 | /// UITextField subclass that inserts a padding around the text rect. 12 | open class PaddedTextField : UITextField { 13 | 14 | /// Padding value to apply around text rect. Used to apply the same padding vertically and horizontally. Getter returns horizontalPadding. 15 | public var padding: CGFloat { 16 | set { 17 | horizontalPadding = newValue 18 | verticalPadding = newValue 19 | } 20 | get { return horizontalPadding } 21 | } 22 | 23 | /// Horizontal padding for text field 24 | public var horizontalPadding : CGFloat = 18.0 25 | 26 | /// Vertical padding for text field 27 | public var verticalPadding : CGFloat = 18.0 28 | 29 | override open func textRect(forBounds bounds: CGRect) -> CGRect { 30 | return myRectForBounds(bounds) 31 | } 32 | 33 | override open func placeholderRect(forBounds bounds: CGRect) -> CGRect { 34 | return myRectForBounds(bounds) 35 | } 36 | 37 | override open func editingRect(forBounds bounds: CGRect) -> CGRect { 38 | return myRectForBounds(bounds) 39 | } 40 | 41 | func myRectForBounds(_ bounds: CGRect) -> CGRect { 42 | return CGRect(x: bounds.origin.x + horizontalPadding, y: bounds.origin.y + verticalPadding, 43 | width: bounds.width - horizontalPadding * 2, height: bounds.height - verticalPadding * 2) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Sources/String+CreditCardRow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String+CreditCardRow.swift 3 | // CreditCardRow 4 | // 5 | // Created by Mathias Claassen on 9/5/16. 6 | // 7 | // 8 | 9 | import Foundation 10 | 11 | public extension String { 12 | 13 | subscript (i: Int) -> Character { 14 | return self[self.index(self.startIndex, offsetBy: i)] 15 | } 16 | 17 | subscript (i: Int) -> String { 18 | return String(self[i] as Character) 19 | } 20 | 21 | subscript (r: Range) -> String { 22 | let start = index(startIndex, offsetBy: r.lowerBound) 23 | let end = index(start, offsetBy: r.upperBound - r.lowerBound) 24 | return String(self[start.. 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 | --------------------------------------------------------------------------------