diff --git a/.swift-version b/.swift-version new file mode 100644 index 0000000..7d5c902 --- /dev/null +++ b/.swift-version @@ -0,0 +1 @@ +4.1 diff --git a/Example/CreditCard.ttf b/Example/CreditCard.ttf new file mode 100644 index 0000000..00abec8 Binary files /dev/null and b/Example/CreditCard.ttf differ diff --git a/Example/Images.xcassets/Contents.json b/Example/Images.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Example/Images.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Images.xcassets/cc_template.imageset/Blank card - Front.png b/Example/Images.xcassets/cc_template.imageset/Blank card - Front.png new file mode 100644 index 0000000..163d35b Binary files /dev/null and b/Example/Images.xcassets/cc_template.imageset/Blank card - Front.png differ diff --git a/Example/Images.xcassets/cc_template.imageset/Contents.json b/Example/Images.xcassets/cc_template.imageset/Contents.json new file mode 100644 index 0000000..c0eb06d --- /dev/null +++ b/Example/Images.xcassets/cc_template.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Blank card - Front.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Images.xcassets/cc_template_american_express.imageset/American express - Front.png b/Example/Images.xcassets/cc_template_american_express.imageset/American express - Front.png new file mode 100644 index 0000000..acff8c9 Binary files /dev/null and b/Example/Images.xcassets/cc_template_american_express.imageset/American express - Front.png differ diff --git a/Example/Images.xcassets/cc_template_american_express.imageset/Contents.json b/Example/Images.xcassets/cc_template_american_express.imageset/Contents.json new file mode 100644 index 0000000..d07de13 --- /dev/null +++ b/Example/Images.xcassets/cc_template_american_express.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "American express - Front.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Images.xcassets/cc_template_american_express_back.imageset/American express - back.png b/Example/Images.xcassets/cc_template_american_express_back.imageset/American express - back.png new file mode 100644 index 0000000..60f050e Binary files /dev/null and b/Example/Images.xcassets/cc_template_american_express_back.imageset/American express - back.png differ diff --git a/Example/Images.xcassets/cc_template_american_express_back.imageset/Contents.json b/Example/Images.xcassets/cc_template_american_express_back.imageset/Contents.json new file mode 100644 index 0000000..f7ae649 --- /dev/null +++ b/Example/Images.xcassets/cc_template_american_express_back.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "American express - back.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Images.xcassets/cc_template_back.imageset/Blank card - back.png b/Example/Images.xcassets/cc_template_back.imageset/Blank card - back.png new file mode 100644 index 0000000..eba1b91 Binary files /dev/null and b/Example/Images.xcassets/cc_template_back.imageset/Blank card - back.png differ diff --git a/Example/Images.xcassets/cc_template_back.imageset/Contents.json b/Example/Images.xcassets/cc_template_back.imageset/Contents.json new file mode 100644 index 0000000..b540942 --- /dev/null +++ b/Example/Images.xcassets/cc_template_back.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Blank card - back.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Images.xcassets/cc_template_dinners_club.imageset/Contents.json b/Example/Images.xcassets/cc_template_dinners_club.imageset/Contents.json new file mode 100644 index 0000000..f89c1b1 --- /dev/null +++ b/Example/Images.xcassets/cc_template_dinners_club.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Diners club - Front.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Images.xcassets/cc_template_dinners_club.imageset/Diners club - Front.png b/Example/Images.xcassets/cc_template_dinners_club.imageset/Diners club - Front.png new file mode 100644 index 0000000..0bf71e9 Binary files /dev/null and b/Example/Images.xcassets/cc_template_dinners_club.imageset/Diners club - Front.png differ diff --git a/Example/Images.xcassets/cc_template_dinners_club_back.imageset/Contents.json b/Example/Images.xcassets/cc_template_dinners_club_back.imageset/Contents.json new file mode 100644 index 0000000..b2257e0 --- /dev/null +++ b/Example/Images.xcassets/cc_template_dinners_club_back.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Diners club- back.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Images.xcassets/cc_template_dinners_club_back.imageset/Diners club- back.png b/Example/Images.xcassets/cc_template_dinners_club_back.imageset/Diners club- back.png new file mode 100644 index 0000000..de4cc3d Binary files /dev/null and b/Example/Images.xcassets/cc_template_dinners_club_back.imageset/Diners club- back.png differ diff --git a/Example/Images.xcassets/cc_template_discover.imageset/Contents.json b/Example/Images.xcassets/cc_template_discover.imageset/Contents.json new file mode 100644 index 0000000..ebfff0e --- /dev/null +++ b/Example/Images.xcassets/cc_template_discover.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Discover - Front.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Images.xcassets/cc_template_discover.imageset/Discover - Front.png b/Example/Images.xcassets/cc_template_discover.imageset/Discover - Front.png new file mode 100644 index 0000000..dfbc71a Binary files /dev/null and b/Example/Images.xcassets/cc_template_discover.imageset/Discover - Front.png differ diff --git a/Example/Images.xcassets/cc_template_discover_back.imageset/Contents.json b/Example/Images.xcassets/cc_template_discover_back.imageset/Contents.json new file mode 100644 index 0000000..3c5da98 --- /dev/null +++ b/Example/Images.xcassets/cc_template_discover_back.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Discover - Back.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Images.xcassets/cc_template_discover_back.imageset/Discover - Back.png b/Example/Images.xcassets/cc_template_discover_back.imageset/Discover - Back.png new file mode 100644 index 0000000..5d532b4 Binary files /dev/null and b/Example/Images.xcassets/cc_template_discover_back.imageset/Discover - Back.png differ diff --git a/Example/Images.xcassets/cc_template_enroute.imageset/Contents.json b/Example/Images.xcassets/cc_template_enroute.imageset/Contents.json new file mode 100644 index 0000000..b5d0868 --- /dev/null +++ b/Example/Images.xcassets/cc_template_enroute.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Enroute - Front.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Images.xcassets/cc_template_enroute.imageset/Enroute - Front.png b/Example/Images.xcassets/cc_template_enroute.imageset/Enroute - Front.png new file mode 100644 index 0000000..fa1ac16 Binary files /dev/null and b/Example/Images.xcassets/cc_template_enroute.imageset/Enroute - Front.png differ diff --git a/Example/Images.xcassets/cc_template_enroute_back.imageset/Contents.json b/Example/Images.xcassets/cc_template_enroute_back.imageset/Contents.json new file mode 100644 index 0000000..3283898 --- /dev/null +++ b/Example/Images.xcassets/cc_template_enroute_back.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Enroute - back.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Images.xcassets/cc_template_enroute_back.imageset/Enroute - back.png b/Example/Images.xcassets/cc_template_enroute_back.imageset/Enroute - back.png new file mode 100644 index 0000000..8a2676f Binary files /dev/null and b/Example/Images.xcassets/cc_template_enroute_back.imageset/Enroute - back.png differ diff --git a/Example/Images.xcassets/cc_template_jcb.imageset/Contents.json b/Example/Images.xcassets/cc_template_jcb.imageset/Contents.json new file mode 100644 index 0000000..d6072a1 --- /dev/null +++ b/Example/Images.xcassets/cc_template_jcb.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "JCB - Front.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Images.xcassets/cc_template_jcb.imageset/JCB - Front.png b/Example/Images.xcassets/cc_template_jcb.imageset/JCB - Front.png new file mode 100644 index 0000000..6c0c065 Binary files /dev/null and b/Example/Images.xcassets/cc_template_jcb.imageset/JCB - Front.png differ diff --git a/Example/Images.xcassets/cc_template_jcb_back.imageset/Contents.json b/Example/Images.xcassets/cc_template_jcb_back.imageset/Contents.json new file mode 100644 index 0000000..358cb47 --- /dev/null +++ b/Example/Images.xcassets/cc_template_jcb_back.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "JCB - Back.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Images.xcassets/cc_template_jcb_back.imageset/JCB - Back.png b/Example/Images.xcassets/cc_template_jcb_back.imageset/JCB - Back.png new file mode 100644 index 0000000..74a76b1 Binary files /dev/null and b/Example/Images.xcassets/cc_template_jcb_back.imageset/JCB - Back.png differ diff --git a/Example/Images.xcassets/cc_template_maestro.imageset/Contents.json b/Example/Images.xcassets/cc_template_maestro.imageset/Contents.json new file mode 100644 index 0000000..0d1532f --- /dev/null +++ b/Example/Images.xcassets/cc_template_maestro.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Meastro - Front.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Images.xcassets/cc_template_maestro.imageset/Meastro - Front.png b/Example/Images.xcassets/cc_template_maestro.imageset/Meastro - Front.png new file mode 100644 index 0000000..34b4053 Binary files /dev/null and b/Example/Images.xcassets/cc_template_maestro.imageset/Meastro - Front.png differ diff --git a/Example/Images.xcassets/cc_template_maestro_back.imageset/Contents.json b/Example/Images.xcassets/cc_template_maestro_back.imageset/Contents.json new file mode 100644 index 0000000..754d98e --- /dev/null +++ b/Example/Images.xcassets/cc_template_maestro_back.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Meastro - back.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Images.xcassets/cc_template_maestro_back.imageset/Meastro - back.png b/Example/Images.xcassets/cc_template_maestro_back.imageset/Meastro - back.png new file mode 100644 index 0000000..136931f Binary files /dev/null and b/Example/Images.xcassets/cc_template_maestro_back.imageset/Meastro - back.png differ diff --git a/Example/Images.xcassets/cc_template_mastercard.imageset/Contents.json b/Example/Images.xcassets/cc_template_mastercard.imageset/Contents.json new file mode 100644 index 0000000..2474cd5 --- /dev/null +++ b/Example/Images.xcassets/cc_template_mastercard.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Mastercard - Front.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Images.xcassets/cc_template_mastercard.imageset/Mastercard - Front.png b/Example/Images.xcassets/cc_template_mastercard.imageset/Mastercard - Front.png new file mode 100644 index 0000000..e36f273 Binary files /dev/null and b/Example/Images.xcassets/cc_template_mastercard.imageset/Mastercard - Front.png differ diff --git a/Example/Images.xcassets/cc_template_mastercard_back.imageset/Contents.json b/Example/Images.xcassets/cc_template_mastercard_back.imageset/Contents.json new file mode 100644 index 0000000..e2b3b27 --- /dev/null +++ b/Example/Images.xcassets/cc_template_mastercard_back.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Mastercard - Back.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Images.xcassets/cc_template_mastercard_back.imageset/Mastercard - Back.png b/Example/Images.xcassets/cc_template_mastercard_back.imageset/Mastercard - Back.png new file mode 100644 index 0000000..ecb0358 Binary files /dev/null and b/Example/Images.xcassets/cc_template_mastercard_back.imageset/Mastercard - Back.png differ diff --git a/Example/Images.xcassets/cc_template_visa.imageset/Contents.json b/Example/Images.xcassets/cc_template_visa.imageset/Contents.json new file mode 100644 index 0000000..3ffde9e --- /dev/null +++ b/Example/Images.xcassets/cc_template_visa.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Visa Card - Front.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Images.xcassets/cc_template_visa.imageset/Visa Card - Front.png b/Example/Images.xcassets/cc_template_visa.imageset/Visa Card - Front.png new file mode 100644 index 0000000..ee2dc9b Binary files /dev/null and b/Example/Images.xcassets/cc_template_visa.imageset/Visa Card - Front.png differ diff --git a/Example/Images.xcassets/cc_template_visa_back.imageset/Contents.json b/Example/Images.xcassets/cc_template_visa_back.imageset/Contents.json new file mode 100644 index 0000000..9b271ec --- /dev/null +++ b/Example/Images.xcassets/cc_template_visa_back.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Visa Card - Back.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Images.xcassets/cc_template_visa_back.imageset/Visa Card - Back.png b/Example/Images.xcassets/cc_template_visa_back.imageset/Visa Card - Back.png new file mode 100644 index 0000000..1a38c70 Binary files /dev/null and b/Example/Images.xcassets/cc_template_visa_back.imageset/Visa Card - Back.png differ diff --git a/Example/Images.xcassets/texture_emboss.imageset/Contents.json b/Example/Images.xcassets/texture_emboss.imageset/Contents.json new file mode 100644 index 0000000..80c1e7e --- /dev/null +++ b/Example/Images.xcassets/texture_emboss.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "texture_emboss.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Images.xcassets/texture_emboss.imageset/texture_emboss.png b/Example/Images.xcassets/texture_emboss.imageset/texture_emboss.png new file mode 100644 index 0000000..941912b Binary files /dev/null and b/Example/Images.xcassets/texture_emboss.imageset/texture_emboss.png differ diff --git a/Example/LSCreditCardForm.xcodeproj/project.pbxproj b/Example/LSCreditCardForm.xcodeproj/project.pbxproj index 9573804..5dc5a6e 100644 --- a/Example/LSCreditCardForm.xcodeproj/project.pbxproj +++ b/Example/LSCreditCardForm.xcodeproj/project.pbxproj @@ -15,6 +15,7 @@ 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; }; 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* Tests.swift */; }; B67A372016775913CAC50090 /* Pods_LSCreditCardForm_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 97C0E85AC21DFEF3B7108A93 /* Pods_LSCreditCardForm_Example.framework */; }; + F4C074E72079074C004AD9B1 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = F4C074E62079074C004AD9B1 /* README.md */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -28,7 +29,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 065308E311C70FA1570A4CA2 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; name = README.md; path = ../README.md; sourceTree = ""; }; + 065308E311C70FA1570A4CA2 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 4964981455171551068F9BF4 /* Pods-LSCreditCardForm_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LSCreditCardForm_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example.release.xcconfig"; sourceTree = ""; }; 4FB5D0A91EDAEB2B8C63D6F2 /* Pods_LSCreditCardForm_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LSCreditCardForm_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 607FACD01AFB9204008FA782 /* LSCreditCardForm_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LSCreditCardForm_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -43,8 +44,9 @@ 607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = ""; }; 7EC3D5A45DFEB73F29984248 /* Pods-LSCreditCardForm_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LSCreditCardForm_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example.debug.xcconfig"; sourceTree = ""; }; 97C0E85AC21DFEF3B7108A93 /* Pods_LSCreditCardForm_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LSCreditCardForm_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - AAEC03F05A37A14188841A1E /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; - EED37B7225226A39E3B1BB5F /* LSCreditCardForm.podspec */ = {isa = PBXFileReference; includeInIndex = 1; name = LSCreditCardForm.podspec; path = ../LSCreditCardForm.podspec; sourceTree = ""; }; + AAEC03F05A37A14188841A1E /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; + EED37B7225226A39E3B1BB5F /* LSCreditCardForm.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LSCreditCardForm.podspec; path = ../LSCreditCardForm.podspec; sourceTree = ""; }; + F4C074E62079074C004AD9B1 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../../README.md; sourceTree = ""; }; FB842F58F473C460B0D91F72 /* Pods-LSCreditCardForm_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LSCreditCardForm_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests.release.xcconfig"; sourceTree = ""; }; FE748CAC038FB090003705F9 /* Pods-LSCreditCardForm_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LSCreditCardForm_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -118,6 +120,7 @@ 607FACD91AFB9204008FA782 /* Main.storyboard */, 607FACDC1AFB9204008FA782 /* Images.xcassets */, 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */, + F4C074E62079074C004AD9B1 /* README.md */, 607FACD31AFB9204008FA782 /* Supporting Files */, ); name = "Example for LSCreditCardForm"; @@ -215,10 +218,12 @@ TargetAttributes = { 607FACCF1AFB9204008FA782 = { CreatedOnToolsVersion = 6.3.1; + DevelopmentTeam = YCJFC623N4; LastSwiftMigration = 0900; }; 607FACE41AFB9204008FA782 = { CreatedOnToolsVersion = 6.3.1; + DevelopmentTeam = YCJFC623N4; LastSwiftMigration = 0900; TestTargetID = 607FACCF1AFB9204008FA782; }; @@ -250,6 +255,7 @@ files = ( 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */, 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */, + F4C074E72079074C004AD9B1 /* README.md in Resources */, 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -517,10 +523,11 @@ baseConfigurationReference = 7EC3D5A45DFEB73F29984248 /* Pods-LSCreditCardForm_Example.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + DEVELOPMENT_TEAM = YCJFC623N4; INFOPLIST_FILE = LSCreditCardForm/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = ExampleApp; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = "com.lb.LSCreditCardForm-Example"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; @@ -532,10 +539,11 @@ baseConfigurationReference = 4964981455171551068F9BF4 /* Pods-LSCreditCardForm_Example.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + DEVELOPMENT_TEAM = YCJFC623N4; INFOPLIST_FILE = LSCreditCardForm/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = ExampleApp; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = "com.lb.LSCreditCardForm-Example"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; @@ -546,6 +554,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = FE748CAC038FB090003705F9 /* Pods-LSCreditCardForm_Tests.debug.xcconfig */; buildSettings = { + DEVELOPMENT_TEAM = YCJFC623N4; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", @@ -567,6 +576,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = FB842F58F473C460B0D91F72 /* Pods-LSCreditCardForm_Tests.release.xcconfig */; buildSettings = { + DEVELOPMENT_TEAM = YCJFC623N4; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", diff --git a/Example/LSCreditCardForm.xcworkspace/contents.xcworkspacedata b/Example/LSCreditCardForm.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..4d2ac07 --- /dev/null +++ b/Example/LSCreditCardForm.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/Example/LSCreditCardForm.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example/LSCreditCardForm.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Example/LSCreditCardForm.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Example/LSCreditCardForm/AppDelegate.swift b/Example/LSCreditCardForm/AppDelegate.swift index b9d5fc4..7df4bca 100644 --- a/Example/LSCreditCardForm/AppDelegate.swift +++ b/Example/LSCreditCardForm/AppDelegate.swift @@ -2,11 +2,11 @@ // AppDelegate.swift // LSCreditCardForm // -// Created by lopdo on 03/20/2018. +// Created by lopdo on 03/16/2018. // Copyright (c) 2018 lopdo. All rights reserved. // -import UIKit +import LSCreditCardForm @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { @@ -16,6 +16,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. + + LSCreditCardFormConfig.CreditCard.softLimitVisaTo16Digits = true return true } diff --git a/Example/LSCreditCardForm/Base.lproj/Main.storyboard b/Example/LSCreditCardForm/Base.lproj/Main.storyboard index 6de6d7b..219ef33 100644 --- a/Example/LSCreditCardForm/Base.lproj/Main.storyboard +++ b/Example/LSCreditCardForm/Base.lproj/Main.storyboard @@ -1,14 +1,45 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -20,11 +51,28 @@ + + + + + + + + + + + + + + + + + diff --git a/Example/LSCreditCardForm/Images.xcassets/Contents.json b/Example/LSCreditCardForm/Images.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Example/LSCreditCardForm/Images.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/LSCreditCardForm/ViewController.swift b/Example/LSCreditCardForm/ViewController.swift index 0690148..92b3804 100644 --- a/Example/LSCreditCardForm/ViewController.swift +++ b/Example/LSCreditCardForm/ViewController.swift @@ -2,17 +2,28 @@ // ViewController.swift // LSCreditCardForm // -// Created by lopdo on 03/20/2018. +// Created by lopdo on 03/16/2018. // Copyright (c) 2018 lopdo. All rights reserved. // import UIKit +import LSCreditCardForm class ViewController: UIViewController { + @IBOutlet var constraintKeyboard: NSLayoutConstraint! + @IBOutlet var viewCCForm: LSCreditCardFormView! + override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. + + NotificationCenter.default.addObserver(self, + selector: #selector(keyboardNotification), + name: NSNotification.Name.UIKeyboardWillChangeFrame, + object: nil) + + viewCCForm.delegate = self } override func didReceiveMemoryWarning() { @@ -20,5 +31,22 @@ class ViewController: UIViewController { // Dispose of any resources that can be recreated. } + + @objc func keyboardNotification(notification: NSNotification) { + if let endFrame = notification.userInfo?[UIKeyboardFrameEndUserInfoKey] as? CGRect { + constraintKeyboard.constant = endFrame.height + view.setNeedsLayout() + view.layoutIfNeeded() + } + } } +extension ViewController: LSCreditCardFormDelegate { + + func didCompleteForm(creditCard: LSCreditCard) { + print(creditCard.number) + print(creditCard.expiration) + print(creditCard.cardHolderName) + print(creditCard.cvv) + } +} diff --git a/Example/Podfile b/Example/Podfile index 494b824..fd8e46b 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -1,4 +1,5 @@ use_frameworks! +platform :ios, '8.0' target 'LSCreditCardForm_Example' do pod 'LSCreditCardForm', :path => '../' diff --git a/Example/Podfile.lock b/Example/Podfile.lock new file mode 100644 index 0000000..0edac6c --- /dev/null +++ b/Example/Podfile.lock @@ -0,0 +1,16 @@ +PODS: + - LSCreditCardForm (1.0.0) + +DEPENDENCIES: + - LSCreditCardForm (from `../`) + +EXTERNAL SOURCES: + LSCreditCardForm: + :path: ../ + +SPEC CHECKSUMS: + LSCreditCardForm: 9727c2e32884f09f7e64792d6c9d8a6932b3af39 + +PODFILE CHECKSUM: 03d9bc629a1c9655a58583c8291eeeb3c44ec0a5 + +COCOAPODS: 1.4.0.beta.2 diff --git a/Example/Pods/Local Podspecs/LSCreditCardForm.podspec.json b/Example/Pods/Local Podspecs/LSCreditCardForm.podspec.json new file mode 100644 index 0000000..6c8995d --- /dev/null +++ b/Example/Pods/Local Podspecs/LSCreditCardForm.podspec.json @@ -0,0 +1,27 @@ +{ + "name": "LSCreditCardForm", + "version": "1.0.0", + "summary": "Simple and engaging credit card form", + "description": "Offer your users engaging way how to enter credit card detail. Task that is usually boring and bothersome can be lightened by presenting it in visually interesting way", + "homepage": "https://github.com/lopdo/LSCreditCardForm", + "license": { + "type": "MIT", + "file": "LICENSE" + }, + "authors": { + "lopdo": "lopenka@gmail.com" + }, + "source": { + "git": "https://github.com/lopdo/LSCreditCardForm.git", + "tag": "1.0.0" + }, + "platforms": { + "ios": "8.0" + }, + "source_files": "LSCreditCardForm/Classes/**/*", + "resource_bundles": { + "LSCreditCardForm": [ + "LSCreditCardForm/Assets/**/*" + ] + } +} diff --git a/Example/Pods/Manifest.lock b/Example/Pods/Manifest.lock new file mode 100644 index 0000000..0edac6c --- /dev/null +++ b/Example/Pods/Manifest.lock @@ -0,0 +1,16 @@ +PODS: + - LSCreditCardForm (1.0.0) + +DEPENDENCIES: + - LSCreditCardForm (from `../`) + +EXTERNAL SOURCES: + LSCreditCardForm: + :path: ../ + +SPEC CHECKSUMS: + LSCreditCardForm: 9727c2e32884f09f7e64792d6c9d8a6932b3af39 + +PODFILE CHECKSUM: 03d9bc629a1c9655a58583c8291eeeb3c44ec0a5 + +COCOAPODS: 1.4.0.beta.2 diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj new file mode 100644 index 0000000..7423b1f --- /dev/null +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -0,0 +1,869 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 19AC88D6F882925F070A0A05A17849BD /* LSTextFieldsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 378AE7234EE6AEF825A3C5D3862ECAFD /* LSTextFieldsView.swift */; }; + 1C43BF800487EBFA2B952F7DAA12A7E0 /* LSViewsCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2025CE92007966D17B7182E6CDD29EC /* LSViewsCoordinator.swift */; }; + 2A6677862A910168037432F5636DBAD6 /* Pods-LSCreditCardForm_Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = F8D2372B3252070464FBC14BEEE80C09 /* Pods-LSCreditCardForm_Example-dummy.m */; }; + 35FBE6F550F858A523491BDC24CA0D11 /* Pods-LSCreditCardForm_Tests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 01F0D3C2C4645DF155BBBB9247D65081 /* Pods-LSCreditCardForm_Tests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 49208EF1211544C7A91317B330A95360 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6604A7D69453B4569E4E4827FB9155A9 /* Foundation.framework */; }; + 5F83F08FD0DBE555743159741025C966 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6604A7D69453B4569E4E4827FB9155A9 /* Foundation.framework */; }; + 5FF941430DFD2C0CE0437A1AC9EBC3E2 /* LSCreditCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 952A12C1D653DDF6385427B066D17CA3 /* LSCreditCardView.swift */; }; + 610E6D792108741E11D62F26F977D009 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4BEEC8A1D815DE077342405F126B9824 /* Images.xcassets */; }; + 69C188E99433893BB13C85DE7CF68E61 /* LSCreditCardForm-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 0CA59A2524A39221262929171BDEC0B2 /* LSCreditCardForm-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6BCCBEE0FACB257478676EA9C1CFCA23 /* LSButtonsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7359771D2F4AB6F2BEBD9615F4C8348 /* LSButtonsView.swift */; }; + 75002BCE59A46E3431A33F3A5CDEF33C /* LSCreditCardFont.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8F30E54A2D2E494BF8B6EC5AA6DF0D9 /* LSCreditCardFont.swift */; }; + 79D8BD38F42D76FE6FDBACA85FDCCD1B /* LSCreditCardFormConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BD79D05D26EC7CF4A0609278E765229 /* LSCreditCardFormConfig.swift */; }; + 9DE3CF77D50A3F36358E9BAEF48DCE27 /* CreditCard.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 13F99476D9039D11043CC00A58024FE7 /* CreditCard.ttf */; }; + AF4814C8B1600AEC27BA4ACB6E6BFFB0 /* Pods-LSCreditCardForm_Tests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BB552C409B702D43AB497772EAA5F37 /* Pods-LSCreditCardForm_Tests-dummy.m */; }; + C608822D4A9040B9EA6A1092A2107247 /* LSCreditCardForm-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = FCCB32320673DB3934D439BE74311332 /* LSCreditCardForm-dummy.m */; }; + C805D3A997AA466177DB838124D65769 /* LSCreditCardForm.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 37D99714A66FDDAF6C1AB3C6830952EB /* LSCreditCardForm.bundle */; }; + CE5D72E36A405D56C02F8271B51A8307 /* LSCreditCardWrapperView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33323172FF7E59979F8E83DF9344192D /* LSCreditCardWrapperView.swift */; }; + D36B22DB1C43057E7CD37867D8858427 /* LSCreditCardFormView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AC142125FB667C90BE2DEE88591B1EC /* LSCreditCardFormView.swift */; }; + DC1B7E6841E94D5A1AFC0CD817835F29 /* Pods-LSCreditCardForm_Example-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = AA112654F316E512A6AAD1232E1CD284 /* Pods-LSCreditCardForm_Example-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DD4E8218C308DB30B74A0B8C3B629301 /* LSCreditCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF9A75F3D623DC0C78B2F5F976C2690B /* LSCreditCard.swift */; }; + E7F9B015FD7ADE3F716800FD4F542139 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6604A7D69453B4569E4E4827FB9155A9 /* Foundation.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 516FFF220E2C3F12FEBBCC7F0CAE9981 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = FFFCD7701C30362F422013A6B3BB010C; + remoteInfo = LSCreditCardForm; + }; + EFE6ADE6E90A924081AABDBFB4846DAE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 2901697F58D6FCC85E0525B5DB08D45E; + remoteInfo = "LSCreditCardForm-LSCreditCardForm"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 01F0D3C2C4645DF155BBBB9247D65081 /* Pods-LSCreditCardForm_Tests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-LSCreditCardForm_Tests-umbrella.h"; sourceTree = ""; }; + 086274BE73081FD09EDF6B01A5D5AAFA /* Pods-LSCreditCardForm_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-LSCreditCardForm_Tests.debug.xcconfig"; sourceTree = ""; }; + 0CA59A2524A39221262929171BDEC0B2 /* LSCreditCardForm-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "LSCreditCardForm-umbrella.h"; sourceTree = ""; }; + 117048ED91455788DE18DF08CA6E96AB /* Pods-LSCreditCardForm_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-LSCreditCardForm_Tests.release.xcconfig"; sourceTree = ""; }; + 13F99476D9039D11043CC00A58024FE7 /* CreditCard.ttf */ = {isa = PBXFileReference; includeInIndex = 1; name = CreditCard.ttf; path = LSCreditCardForm/Assets/CreditCard.ttf; sourceTree = ""; }; + 17C58F81EB947B0C7DD1CD2A750E8C3E /* LSCreditCardForm.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = LSCreditCardForm.xcconfig; sourceTree = ""; }; + 1EC5E2D3CCDFD6E2C763037CB96CEAA1 /* Pods-LSCreditCardForm_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-LSCreditCardForm_Example.debug.xcconfig"; sourceTree = ""; }; + 25F893BFFFE01EB66E8B5F1B34CB33FF /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 2E263051CBB450459E09F06A3500F5A8 /* Pods-LSCreditCardForm_Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-LSCreditCardForm_Example-acknowledgements.markdown"; sourceTree = ""; }; + 33323172FF7E59979F8E83DF9344192D /* LSCreditCardWrapperView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LSCreditCardWrapperView.swift; path = LSCreditCardForm/Classes/LSCreditCardWrapperView.swift; sourceTree = ""; }; + 378AE7234EE6AEF825A3C5D3862ECAFD /* LSTextFieldsView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LSTextFieldsView.swift; path = LSCreditCardForm/Classes/LSTextFieldsView.swift; sourceTree = ""; }; + 37D99714A66FDDAF6C1AB3C6830952EB /* LSCreditCardForm.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; name = LSCreditCardForm.bundle; path = "LSCreditCardForm-LSCreditCardForm.bundle"; sourceTree = BUILT_PRODUCTS_DIR; }; + 3BA7CE1A38C054D7F21C71A196C9A035 /* Pods-LSCreditCardForm_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-LSCreditCardForm_Example.release.xcconfig"; sourceTree = ""; }; + 3D8DC78B64E3A483CCBD3379B949C87D /* Pods_LSCreditCardForm_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_LSCreditCardForm_Example.framework; path = "Pods-LSCreditCardForm_Example.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + 4254A45D034657195E8ED0FD3565D60E /* Pods-LSCreditCardForm_Tests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-LSCreditCardForm_Tests-acknowledgements.plist"; sourceTree = ""; }; + 490934C8D2717CAA6A4FA4AC301F06A7 /* Pods-LSCreditCardForm_Tests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-LSCreditCardForm_Tests-frameworks.sh"; sourceTree = ""; }; + 4BB552C409B702D43AB497772EAA5F37 /* Pods-LSCreditCardForm_Tests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-LSCreditCardForm_Tests-dummy.m"; sourceTree = ""; }; + 4BEEC8A1D815DE077342405F126B9824 /* Images.xcassets */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = LSCreditCardForm/Assets/Images.xcassets; sourceTree = ""; }; + 4C4DA4A66815EA54D6E5148BB61FC963 /* LSCreditCardForm-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "LSCreditCardForm-prefix.pch"; sourceTree = ""; }; + 54637E625913799DFC4C2CB7A1FB4ADF /* Pods-LSCreditCardForm_Example-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-LSCreditCardForm_Example-resources.sh"; sourceTree = ""; }; + 5AC142125FB667C90BE2DEE88591B1EC /* LSCreditCardFormView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LSCreditCardFormView.swift; path = LSCreditCardForm/Classes/LSCreditCardFormView.swift; sourceTree = ""; }; + 6604A7D69453B4569E4E4827FB9155A9 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + 7BD79D05D26EC7CF4A0609278E765229 /* LSCreditCardFormConfig.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LSCreditCardFormConfig.swift; path = LSCreditCardForm/Classes/LSCreditCardFormConfig.swift; sourceTree = ""; }; + 7BF4B8397C046D7E948795F42B0C58D8 /* LSCreditCardForm.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = LSCreditCardForm.modulemap; sourceTree = ""; }; + 7EBBF6A2B18E362441B9BBDE77709E03 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 856AE1FA28A06D3D5E0E9ED7BE1A1BD8 /* Pods-LSCreditCardForm_Tests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-LSCreditCardForm_Tests-acknowledgements.markdown"; sourceTree = ""; }; + 8B0709EDB255685D2CE62E234CA2290C /* LSCreditCardForm.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = LSCreditCardForm.framework; path = LSCreditCardForm.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 952A12C1D653DDF6385427B066D17CA3 /* LSCreditCardView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LSCreditCardView.swift; path = LSCreditCardForm/Classes/LSCreditCardView.swift; sourceTree = ""; }; + A2025CE92007966D17B7182E6CDD29EC /* LSViewsCoordinator.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LSViewsCoordinator.swift; path = LSCreditCardForm/Classes/LSViewsCoordinator.swift; sourceTree = ""; }; + A30184F31F3DC7A0632298DABD29C73A /* Pods-LSCreditCardForm_Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-LSCreditCardForm_Example-acknowledgements.plist"; sourceTree = ""; }; + A7359771D2F4AB6F2BEBD9615F4C8348 /* LSButtonsView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LSButtonsView.swift; path = LSCreditCardForm/Classes/LSButtonsView.swift; sourceTree = ""; }; + AA112654F316E512A6AAD1232E1CD284 /* Pods-LSCreditCardForm_Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-LSCreditCardForm_Example-umbrella.h"; sourceTree = ""; }; + BF9A75F3D623DC0C78B2F5F976C2690B /* LSCreditCard.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LSCreditCard.swift; path = LSCreditCardForm/Classes/LSCreditCard.swift; sourceTree = ""; }; + CFDEA7CCF4CB9672496C981349C9B570 /* Pods-LSCreditCardForm_Tests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-LSCreditCardForm_Tests-resources.sh"; sourceTree = ""; }; + D026E0DE9CDF9E0C997BFAE77AE83D15 /* Pods_LSCreditCardForm_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_LSCreditCardForm_Tests.framework; path = "Pods-LSCreditCardForm_Tests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + E5645B8D77588D6F03B76FAC33C0DB7D /* Pods-LSCreditCardForm_Tests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-LSCreditCardForm_Tests.modulemap"; sourceTree = ""; }; + E8A6A11489B3B7496B8638F66A2DEA6D /* ResourceBundle-LSCreditCardForm-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "ResourceBundle-LSCreditCardForm-Info.plist"; sourceTree = ""; }; + E8F30E54A2D2E494BF8B6EC5AA6DF0D9 /* LSCreditCardFont.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LSCreditCardFont.swift; path = LSCreditCardForm/Classes/LSCreditCardFont.swift; sourceTree = ""; }; + EDEE8BFCFC6644C870F7543CFE10F328 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + F05271F68756B70E6E2FE99E91B04321 /* Pods-LSCreditCardForm_Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-LSCreditCardForm_Example-frameworks.sh"; sourceTree = ""; }; + F8D2372B3252070464FBC14BEEE80C09 /* Pods-LSCreditCardForm_Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-LSCreditCardForm_Example-dummy.m"; sourceTree = ""; }; + F91EFBFBECACB2818FC3D41D352A206E /* Pods-LSCreditCardForm_Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-LSCreditCardForm_Example.modulemap"; sourceTree = ""; }; + FCCB32320673DB3934D439BE74311332 /* LSCreditCardForm-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "LSCreditCardForm-dummy.m"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 7E87DF465B67EE3F3D5CBD7FA21A3ED3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 5F83F08FD0DBE555743159741025C966 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8FAF49AA0CAD0AF3B3027BD5A4BB699E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95A3AD38BA0CE070483A696781A79F48 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 49208EF1211544C7A91317B330A95360 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DE44C1118FCC06B348A587755E7AD227 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + E7F9B015FD7ADE3F716800FD4F542139 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 226F61EEA10BE90C9F3FBC0B770A8B0C /* Resources */ = { + isa = PBXGroup; + children = ( + 13F99476D9039D11043CC00A58024FE7 /* CreditCard.ttf */, + 4BEEC8A1D815DE077342405F126B9824 /* Images.xcassets */, + ); + name = Resources; + sourceTree = ""; + }; + 601F76D343123C31B77A7096B6E021D6 /* Targets Support Files */ = { + isa = PBXGroup; + children = ( + 9CFE8D79A4F7575B612B2412FFA0F535 /* Pods-LSCreditCardForm_Example */, + D3B6F7603EB9A210A6BE4900F3579A56 /* Pods-LSCreditCardForm_Tests */, + ); + name = "Targets Support Files"; + sourceTree = ""; + }; + 688F6A981799F952F195383514ED11B0 /* Development Pods */ = { + isa = PBXGroup; + children = ( + 884521E9C86D6359DC10B00C7DA7D540 /* LSCreditCardForm */, + ); + name = "Development Pods"; + sourceTree = ""; + }; + 7DB346D0F39D3F0E887471402A8071AB = { + isa = PBXGroup; + children = ( + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, + 688F6A981799F952F195383514ED11B0 /* Development Pods */, + BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */, + E941094FDC61D73337A6D8FB069CA3AD /* Products */, + 601F76D343123C31B77A7096B6E021D6 /* Targets Support Files */, + ); + sourceTree = ""; + }; + 817583DEE58320E8C76184AB047B9065 /* Support Files */ = { + isa = PBXGroup; + children = ( + 25F893BFFFE01EB66E8B5F1B34CB33FF /* Info.plist */, + 7BF4B8397C046D7E948795F42B0C58D8 /* LSCreditCardForm.modulemap */, + 17C58F81EB947B0C7DD1CD2A750E8C3E /* LSCreditCardForm.xcconfig */, + FCCB32320673DB3934D439BE74311332 /* LSCreditCardForm-dummy.m */, + 4C4DA4A66815EA54D6E5148BB61FC963 /* LSCreditCardForm-prefix.pch */, + 0CA59A2524A39221262929171BDEC0B2 /* LSCreditCardForm-umbrella.h */, + E8A6A11489B3B7496B8638F66A2DEA6D /* ResourceBundle-LSCreditCardForm-Info.plist */, + ); + name = "Support Files"; + path = "Example/Pods/Target Support Files/LSCreditCardForm"; + sourceTree = ""; + }; + 884521E9C86D6359DC10B00C7DA7D540 /* LSCreditCardForm */ = { + isa = PBXGroup; + children = ( + A7359771D2F4AB6F2BEBD9615F4C8348 /* LSButtonsView.swift */, + BF9A75F3D623DC0C78B2F5F976C2690B /* LSCreditCard.swift */, + E8F30E54A2D2E494BF8B6EC5AA6DF0D9 /* LSCreditCardFont.swift */, + 7BD79D05D26EC7CF4A0609278E765229 /* LSCreditCardFormConfig.swift */, + 5AC142125FB667C90BE2DEE88591B1EC /* LSCreditCardFormView.swift */, + 952A12C1D653DDF6385427B066D17CA3 /* LSCreditCardView.swift */, + 33323172FF7E59979F8E83DF9344192D /* LSCreditCardWrapperView.swift */, + 378AE7234EE6AEF825A3C5D3862ECAFD /* LSTextFieldsView.swift */, + A2025CE92007966D17B7182E6CDD29EC /* LSViewsCoordinator.swift */, + 226F61EEA10BE90C9F3FBC0B770A8B0C /* Resources */, + 817583DEE58320E8C76184AB047B9065 /* Support Files */, + ); + name = LSCreditCardForm; + path = ../..; + sourceTree = ""; + }; + 9CFE8D79A4F7575B612B2412FFA0F535 /* Pods-LSCreditCardForm_Example */ = { + isa = PBXGroup; + children = ( + EDEE8BFCFC6644C870F7543CFE10F328 /* Info.plist */, + F91EFBFBECACB2818FC3D41D352A206E /* Pods-LSCreditCardForm_Example.modulemap */, + 2E263051CBB450459E09F06A3500F5A8 /* Pods-LSCreditCardForm_Example-acknowledgements.markdown */, + A30184F31F3DC7A0632298DABD29C73A /* Pods-LSCreditCardForm_Example-acknowledgements.plist */, + F8D2372B3252070464FBC14BEEE80C09 /* Pods-LSCreditCardForm_Example-dummy.m */, + F05271F68756B70E6E2FE99E91B04321 /* Pods-LSCreditCardForm_Example-frameworks.sh */, + 54637E625913799DFC4C2CB7A1FB4ADF /* Pods-LSCreditCardForm_Example-resources.sh */, + AA112654F316E512A6AAD1232E1CD284 /* Pods-LSCreditCardForm_Example-umbrella.h */, + 1EC5E2D3CCDFD6E2C763037CB96CEAA1 /* Pods-LSCreditCardForm_Example.debug.xcconfig */, + 3BA7CE1A38C054D7F21C71A196C9A035 /* Pods-LSCreditCardForm_Example.release.xcconfig */, + ); + name = "Pods-LSCreditCardForm_Example"; + path = "Target Support Files/Pods-LSCreditCardForm_Example"; + sourceTree = ""; + }; + BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */ = { + isa = PBXGroup; + children = ( + D35AF013A5F0BAD4F32504907A52519E /* iOS */, + ); + name = Frameworks; + sourceTree = ""; + }; + D35AF013A5F0BAD4F32504907A52519E /* iOS */ = { + isa = PBXGroup; + children = ( + 6604A7D69453B4569E4E4827FB9155A9 /* Foundation.framework */, + ); + name = iOS; + sourceTree = ""; + }; + D3B6F7603EB9A210A6BE4900F3579A56 /* Pods-LSCreditCardForm_Tests */ = { + isa = PBXGroup; + children = ( + 7EBBF6A2B18E362441B9BBDE77709E03 /* Info.plist */, + E5645B8D77588D6F03B76FAC33C0DB7D /* Pods-LSCreditCardForm_Tests.modulemap */, + 856AE1FA28A06D3D5E0E9ED7BE1A1BD8 /* Pods-LSCreditCardForm_Tests-acknowledgements.markdown */, + 4254A45D034657195E8ED0FD3565D60E /* Pods-LSCreditCardForm_Tests-acknowledgements.plist */, + 4BB552C409B702D43AB497772EAA5F37 /* Pods-LSCreditCardForm_Tests-dummy.m */, + 490934C8D2717CAA6A4FA4AC301F06A7 /* Pods-LSCreditCardForm_Tests-frameworks.sh */, + CFDEA7CCF4CB9672496C981349C9B570 /* Pods-LSCreditCardForm_Tests-resources.sh */, + 01F0D3C2C4645DF155BBBB9247D65081 /* Pods-LSCreditCardForm_Tests-umbrella.h */, + 086274BE73081FD09EDF6B01A5D5AAFA /* Pods-LSCreditCardForm_Tests.debug.xcconfig */, + 117048ED91455788DE18DF08CA6E96AB /* Pods-LSCreditCardForm_Tests.release.xcconfig */, + ); + name = "Pods-LSCreditCardForm_Tests"; + path = "Target Support Files/Pods-LSCreditCardForm_Tests"; + sourceTree = ""; + }; + E941094FDC61D73337A6D8FB069CA3AD /* Products */ = { + isa = PBXGroup; + children = ( + 37D99714A66FDDAF6C1AB3C6830952EB /* LSCreditCardForm.bundle */, + 8B0709EDB255685D2CE62E234CA2290C /* LSCreditCardForm.framework */, + 3D8DC78B64E3A483CCBD3379B949C87D /* Pods_LSCreditCardForm_Example.framework */, + D026E0DE9CDF9E0C997BFAE77AE83D15 /* Pods_LSCreditCardForm_Tests.framework */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 4C92E42C40ADF8CFC1A10137C469A64C /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 69C188E99433893BB13C85DE7CF68E61 /* LSCreditCardForm-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 4D456B475A20F61E2F87AA8C14622ED0 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 35FBE6F550F858A523491BDC24CA0D11 /* Pods-LSCreditCardForm_Tests-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 9DA3E3449E81245749E3ACF46AE326F2 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + DC1B7E6841E94D5A1AFC0CD817835F29 /* Pods-LSCreditCardForm_Example-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 180A0017D0D159EB465B47B7953091A4 /* Pods-LSCreditCardForm_Tests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 803B5FE2FD72C68A9F233FC9F3567603 /* Build configuration list for PBXNativeTarget "Pods-LSCreditCardForm_Tests" */; + buildPhases = ( + A46D48A7B9DAC2E6E81150ED400FCE5F /* Sources */, + 95A3AD38BA0CE070483A696781A79F48 /* Frameworks */, + 4D456B475A20F61E2F87AA8C14622ED0 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Pods-LSCreditCardForm_Tests"; + productName = "Pods-LSCreditCardForm_Tests"; + productReference = D026E0DE9CDF9E0C997BFAE77AE83D15 /* Pods_LSCreditCardForm_Tests.framework */; + productType = "com.apple.product-type.framework"; + }; + 2901697F58D6FCC85E0525B5DB08D45E /* LSCreditCardForm-LSCreditCardForm */ = { + isa = PBXNativeTarget; + buildConfigurationList = CC4E23F4C55534517243BC77D973B56D /* Build configuration list for PBXNativeTarget "LSCreditCardForm-LSCreditCardForm" */; + buildPhases = ( + 684E146DFE8B01B4A9A76B3886D0BD7C /* Sources */, + 8FAF49AA0CAD0AF3B3027BD5A4BB699E /* Frameworks */, + F9FC88DCFE9AA06F749CCFEE2394B696 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "LSCreditCardForm-LSCreditCardForm"; + productName = "LSCreditCardForm-LSCreditCardForm"; + productReference = 37D99714A66FDDAF6C1AB3C6830952EB /* LSCreditCardForm.bundle */; + productType = "com.apple.product-type.bundle"; + }; + DEAD1D13FA765B731057329E879D6EB2 /* Pods-LSCreditCardForm_Example */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8D92AB179948881D9870931513F385C7 /* Build configuration list for PBXNativeTarget "Pods-LSCreditCardForm_Example" */; + buildPhases = ( + B1B6504D004377B63CFD247FD36F5588 /* Sources */, + DE44C1118FCC06B348A587755E7AD227 /* Frameworks */, + 9DA3E3449E81245749E3ACF46AE326F2 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + C00F2DFE82FF6C6F206AC0BD53DE6170 /* PBXTargetDependency */, + ); + name = "Pods-LSCreditCardForm_Example"; + productName = "Pods-LSCreditCardForm_Example"; + productReference = 3D8DC78B64E3A483CCBD3379B949C87D /* Pods_LSCreditCardForm_Example.framework */; + productType = "com.apple.product-type.framework"; + }; + FFFCD7701C30362F422013A6B3BB010C /* LSCreditCardForm */ = { + isa = PBXNativeTarget; + buildConfigurationList = 84B7F700FCBAC237576F4DF4395C48AC /* Build configuration list for PBXNativeTarget "LSCreditCardForm" */; + buildPhases = ( + 1213219578ED09AB5CE13D1435AC1BCA /* Sources */, + 7E87DF465B67EE3F3D5CBD7FA21A3ED3 /* Frameworks */, + 4AFB8F5331E099440E387DCA9529C698 /* Resources */, + 4C92E42C40ADF8CFC1A10137C469A64C /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + 7D6A2CA9FF59CFF4DB637B0A63AEF087 /* PBXTargetDependency */, + ); + name = LSCreditCardForm; + productName = LSCreditCardForm; + productReference = 8B0709EDB255685D2CE62E234CA2290C /* LSCreditCardForm.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0830; + LastUpgradeCheck = 0700; + }; + buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 7DB346D0F39D3F0E887471402A8071AB; + productRefGroup = E941094FDC61D73337A6D8FB069CA3AD /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + FFFCD7701C30362F422013A6B3BB010C /* LSCreditCardForm */, + 2901697F58D6FCC85E0525B5DB08D45E /* LSCreditCardForm-LSCreditCardForm */, + DEAD1D13FA765B731057329E879D6EB2 /* Pods-LSCreditCardForm_Example */, + 180A0017D0D159EB465B47B7953091A4 /* Pods-LSCreditCardForm_Tests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 4AFB8F5331E099440E387DCA9529C698 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C805D3A997AA466177DB838124D65769 /* LSCreditCardForm.bundle in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F9FC88DCFE9AA06F749CCFEE2394B696 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9DE3CF77D50A3F36358E9BAEF48DCE27 /* CreditCard.ttf in Resources */, + 610E6D792108741E11D62F26F977D009 /* Images.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 1213219578ED09AB5CE13D1435AC1BCA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6BCCBEE0FACB257478676EA9C1CFCA23 /* LSButtonsView.swift in Sources */, + DD4E8218C308DB30B74A0B8C3B629301 /* LSCreditCard.swift in Sources */, + 75002BCE59A46E3431A33F3A5CDEF33C /* LSCreditCardFont.swift in Sources */, + C608822D4A9040B9EA6A1092A2107247 /* LSCreditCardForm-dummy.m in Sources */, + 79D8BD38F42D76FE6FDBACA85FDCCD1B /* LSCreditCardFormConfig.swift in Sources */, + D36B22DB1C43057E7CD37867D8858427 /* LSCreditCardFormView.swift in Sources */, + 5FF941430DFD2C0CE0437A1AC9EBC3E2 /* LSCreditCardView.swift in Sources */, + CE5D72E36A405D56C02F8271B51A8307 /* LSCreditCardWrapperView.swift in Sources */, + 19AC88D6F882925F070A0A05A17849BD /* LSTextFieldsView.swift in Sources */, + 1C43BF800487EBFA2B952F7DAA12A7E0 /* LSViewsCoordinator.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 684E146DFE8B01B4A9A76B3886D0BD7C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A46D48A7B9DAC2E6E81150ED400FCE5F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + AF4814C8B1600AEC27BA4ACB6E6BFFB0 /* Pods-LSCreditCardForm_Tests-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + B1B6504D004377B63CFD247FD36F5588 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2A6677862A910168037432F5636DBAD6 /* Pods-LSCreditCardForm_Example-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 7D6A2CA9FF59CFF4DB637B0A63AEF087 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "LSCreditCardForm-LSCreditCardForm"; + target = 2901697F58D6FCC85E0525B5DB08D45E /* LSCreditCardForm-LSCreditCardForm */; + targetProxy = EFE6ADE6E90A924081AABDBFB4846DAE /* PBXContainerItemProxy */; + }; + C00F2DFE82FF6C6F206AC0BD53DE6170 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = LSCreditCardForm; + target = FFFCD7701C30362F422013A6B3BB010C /* LSCreditCardForm */; + targetProxy = 516FFF220E2C3F12FEBBCC7F0CAE9981 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 0076EE8E3D9C7C75EE23C542C4B9B011 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 117048ED91455788DE18DF08CA6E96AB /* Pods-LSCreditCardForm_Tests.release.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-LSCreditCardForm_Tests/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_LSCreditCardForm_Tests; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 11E648EEE978AEBAC6944CECE0D3D35C /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 17C58F81EB947B0C7DD1CD2A750E8C3E /* LSCreditCardForm.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/LSCreditCardForm/LSCreditCardForm-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/LSCreditCardForm/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/LSCreditCardForm/LSCreditCardForm.modulemap"; + PRODUCT_NAME = LSCreditCardForm; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 22FD74A639168ED3433DA4519FDE4B57 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 17C58F81EB947B0C7DD1CD2A750E8C3E /* LSCreditCardForm.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/LSCreditCardForm"; + INFOPLIST_FILE = "Target Support Files/LSCreditCardForm/ResourceBundle-LSCreditCardForm-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + PRODUCT_NAME = LSCreditCardForm; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + WRAPPER_EXTENSION = bundle; + }; + name = Release; + }; + 7AFBBCE54EDE8617ACE4B00871F7F7DC /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 17C58F81EB947B0C7DD1CD2A750E8C3E /* LSCreditCardForm.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/LSCreditCardForm/LSCreditCardForm-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/LSCreditCardForm/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/LSCreditCardForm/LSCreditCardForm.modulemap"; + PRODUCT_NAME = LSCreditCardForm; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 87D0B12C0EC9F4C076E0620D8C7C5DDE /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 17C58F81EB947B0C7DD1CD2A750E8C3E /* LSCreditCardForm.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/LSCreditCardForm"; + INFOPLIST_FILE = "Target Support Files/LSCreditCardForm/ResourceBundle-LSCreditCardForm-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + PRODUCT_NAME = LSCreditCardForm; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + WRAPPER_EXTENSION = bundle; + }; + name = Debug; + }; + 9C889CFCE099524D1EB0A310B27A79EB /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3BA7CE1A38C054D7F21C71A196C9A035 /* Pods-LSCreditCardForm_Example.release.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-LSCreditCardForm_Example/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_LSCreditCardForm_Example; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + B254DAA6CF0CE39F4A3D11B90A7E059A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGNING_REQUIRED = NO; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_RELEASE=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Release; + }; + D5547C1696567670BFABF78A28F08582 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 1EC5E2D3CCDFD6E2C763037CB96CEAA1 /* Pods-LSCreditCardForm_Example.debug.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-LSCreditCardForm_Example/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_LSCreditCardForm_Example; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + DC59E1346756FF090FC1CBDC29E9D01C /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 086274BE73081FD09EDF6B01A5D5AAFA /* Pods-LSCreditCardForm_Tests.debug.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-LSCreditCardForm_Tests/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_LSCreditCardForm_Tests; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + E4B68EE12B21C47CB798D9B1ECA6D7A7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGNING_REQUIRED = NO; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_DEBUG=1", + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; + STRIP_INSTALLED_PRODUCT = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Debug; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E4B68EE12B21C47CB798D9B1ECA6D7A7 /* Debug */, + B254DAA6CF0CE39F4A3D11B90A7E059A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 803B5FE2FD72C68A9F233FC9F3567603 /* Build configuration list for PBXNativeTarget "Pods-LSCreditCardForm_Tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DC59E1346756FF090FC1CBDC29E9D01C /* Debug */, + 0076EE8E3D9C7C75EE23C542C4B9B011 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 84B7F700FCBAC237576F4DF4395C48AC /* Build configuration list for PBXNativeTarget "LSCreditCardForm" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 11E648EEE978AEBAC6944CECE0D3D35C /* Debug */, + 7AFBBCE54EDE8617ACE4B00871F7F7DC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8D92AB179948881D9870931513F385C7 /* Build configuration list for PBXNativeTarget "Pods-LSCreditCardForm_Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D5547C1696567670BFABF78A28F08582 /* Debug */, + 9C889CFCE099524D1EB0A310B27A79EB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CC4E23F4C55534517243BC77D973B56D /* Build configuration list for PBXNativeTarget "LSCreditCardForm-LSCreditCardForm" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 87D0B12C0EC9F4C076E0620D8C7C5DDE /* Debug */, + 22FD74A639168ED3433DA4519FDE4B57 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; +} diff --git a/Example/Pods/Target Support Files/LSCreditCardForm/Info.plist b/Example/Pods/Target Support Files/LSCreditCardForm/Info.plist new file mode 100644 index 0000000..2243fe6 --- /dev/null +++ b/Example/Pods/Target Support Files/LSCreditCardForm/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/LSCreditCardForm/LSCreditCardForm-dummy.m b/Example/Pods/Target Support Files/LSCreditCardForm/LSCreditCardForm-dummy.m new file mode 100644 index 0000000..3907725 --- /dev/null +++ b/Example/Pods/Target Support Files/LSCreditCardForm/LSCreditCardForm-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_LSCreditCardForm : NSObject +@end +@implementation PodsDummy_LSCreditCardForm +@end diff --git a/Example/Pods/Target Support Files/LSCreditCardForm/LSCreditCardForm-prefix.pch b/Example/Pods/Target Support Files/LSCreditCardForm/LSCreditCardForm-prefix.pch new file mode 100644 index 0000000..beb2a24 --- /dev/null +++ b/Example/Pods/Target Support Files/LSCreditCardForm/LSCreditCardForm-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/Example/Pods/Target Support Files/LSCreditCardForm/LSCreditCardForm-umbrella.h b/Example/Pods/Target Support Files/LSCreditCardForm/LSCreditCardForm-umbrella.h new file mode 100644 index 0000000..291c62b --- /dev/null +++ b/Example/Pods/Target Support Files/LSCreditCardForm/LSCreditCardForm-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double LSCreditCardFormVersionNumber; +FOUNDATION_EXPORT const unsigned char LSCreditCardFormVersionString[]; + diff --git a/Example/Pods/Target Support Files/LSCreditCardForm/LSCreditCardForm.modulemap b/Example/Pods/Target Support Files/LSCreditCardForm/LSCreditCardForm.modulemap new file mode 100644 index 0000000..539192b --- /dev/null +++ b/Example/Pods/Target Support Files/LSCreditCardForm/LSCreditCardForm.modulemap @@ -0,0 +1,6 @@ +framework module LSCreditCardForm { + umbrella header "LSCreditCardForm-umbrella.h" + + export * + module * { export * } +} diff --git a/Example/Pods/Target Support Files/LSCreditCardForm/LSCreditCardForm.xcconfig b/Example/Pods/Target Support Files/LSCreditCardForm/LSCreditCardForm.xcconfig new file mode 100644 index 0000000..db88e07 --- /dev/null +++ b/Example/Pods/Target Support Files/LSCreditCardForm/LSCreditCardForm.xcconfig @@ -0,0 +1,10 @@ +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/LSCreditCardForm +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/Example/Pods/Target Support Files/LSCreditCardForm/ResourceBundle-LSCreditCardForm-Info.plist b/Example/Pods/Target Support Files/LSCreditCardForm/ResourceBundle-LSCreditCardForm-Info.plist new file mode 100644 index 0000000..e148b98 --- /dev/null +++ b/Example/Pods/Target Support Files/LSCreditCardForm/ResourceBundle-LSCreditCardForm-Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Info.plist b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Info.plist new file mode 100644 index 0000000..2243fe6 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example-acknowledgements.markdown b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example-acknowledgements.markdown new file mode 100644 index 0000000..3fa7f6d --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example-acknowledgements.markdown @@ -0,0 +1,26 @@ +# Acknowledgements +This application makes use of the following third party libraries: + +## LSCreditCardForm + +Copyright (c) 2018 lopdo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +Generated by CocoaPods - https://cocoapods.org diff --git a/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example-acknowledgements.plist b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example-acknowledgements.plist new file mode 100644 index 0000000..89add72 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example-acknowledgements.plist @@ -0,0 +1,58 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2018 lopdo <lopenka@gmail.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + License + MIT + Title + LSCreditCardForm + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - https://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example-dummy.m b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example-dummy.m new file mode 100644 index 0000000..038306a --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_LSCreditCardForm_Example : NSObject +@end +@implementation PodsDummy_Pods_LSCreditCardForm_Example +@end diff --git a/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example-frameworks.sh b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example-frameworks.sh new file mode 100755 index 0000000..44f23a3 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example-frameworks.sh @@ -0,0 +1,121 @@ +#!/bin/sh +set -e + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Copies the dSYM of a vendored framework +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}" + fi + + local basename + basename="$(basename -s .framework.dSYM "$source")" + binary="${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then + strip_invalid_archs "$binary" + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current file + archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" + stripped="" + for arch in $archs; do + if ! [[ "${ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi +} + + +if [[ "$CONFIGURATION" == "Debug" ]]; then + install_framework "${BUILT_PRODUCTS_DIR}/LSCreditCardForm/LSCreditCardForm.framework" +fi +if [[ "$CONFIGURATION" == "Release" ]]; then + install_framework "${BUILT_PRODUCTS_DIR}/LSCreditCardForm/LSCreditCardForm.framework" +fi +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait +fi diff --git a/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example-resources.sh b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example-resources.sh new file mode 100755 index 0000000..a7df440 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example-resources.sh @@ -0,0 +1,106 @@ +#!/bin/sh +set -e + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +case "${TARGETED_DEVICE_FAMILY}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; +esac + +install_resource() +{ + if [[ "$1" = /* ]] ; then + RESOURCE_PATH="$1" + else + RESOURCE_PATH="${PODS_ROOT}/$1" + fi + if [[ ! -e "$RESOURCE_PATH" ]] ; then + cat << EOM +error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. +EOM + exit 1 + fi + case $RESOURCE_PATH in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.framework) + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true + xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + *) + echo "$RESOURCE_PATH" || true + echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] +then + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "${PODS_ROOT}*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi diff --git a/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example-umbrella.h b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example-umbrella.h new file mode 100644 index 0000000..fda3442 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double Pods_LSCreditCardForm_ExampleVersionNumber; +FOUNDATION_EXPORT const unsigned char Pods_LSCreditCardForm_ExampleVersionString[]; + diff --git a/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example.debug.xcconfig b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example.debug.xcconfig new file mode 100644 index 0000000..624c827 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example.debug.xcconfig @@ -0,0 +1,11 @@ +ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LSCreditCardForm" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/LSCreditCardForm/LSCreditCardForm.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "LSCreditCardForm" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example.modulemap b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example.modulemap new file mode 100644 index 0000000..cbf2ad5 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example.modulemap @@ -0,0 +1,6 @@ +framework module Pods_LSCreditCardForm_Example { + umbrella header "Pods-LSCreditCardForm_Example-umbrella.h" + + export * + module * { export * } +} diff --git a/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example.release.xcconfig b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example.release.xcconfig new file mode 100644 index 0000000..624c827 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Example/Pods-LSCreditCardForm_Example.release.xcconfig @@ -0,0 +1,11 @@ +ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LSCreditCardForm" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/LSCreditCardForm/LSCreditCardForm.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "LSCreditCardForm" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Info.plist b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Info.plist new file mode 100644 index 0000000..2243fe6 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests-acknowledgements.markdown b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests-acknowledgements.markdown new file mode 100644 index 0000000..102af75 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests-acknowledgements.markdown @@ -0,0 +1,3 @@ +# Acknowledgements +This application makes use of the following third party libraries: +Generated by CocoaPods - https://cocoapods.org diff --git a/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests-acknowledgements.plist b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests-acknowledgements.plist new file mode 100644 index 0000000..7acbad1 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests-acknowledgements.plist @@ -0,0 +1,29 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - https://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests-dummy.m b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests-dummy.m new file mode 100644 index 0000000..5b29ee8 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_LSCreditCardForm_Tests : NSObject +@end +@implementation PodsDummy_Pods_LSCreditCardForm_Tests +@end diff --git a/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests-frameworks.sh b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests-frameworks.sh new file mode 100755 index 0000000..2e0a8a5 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests-frameworks.sh @@ -0,0 +1,114 @@ +#!/bin/sh +set -e + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Copies the dSYM of a vendored framework +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}" + fi + + local basename + basename="$(basename -s .framework.dSYM "$source")" + binary="${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then + strip_invalid_archs "$binary" + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current file + archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" + stripped="" + for arch in $archs; do + if ! [[ "${ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi +} + +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait +fi diff --git a/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests-resources.sh b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests-resources.sh new file mode 100755 index 0000000..a7df440 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests-resources.sh @@ -0,0 +1,106 @@ +#!/bin/sh +set -e + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +case "${TARGETED_DEVICE_FAMILY}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; +esac + +install_resource() +{ + if [[ "$1" = /* ]] ; then + RESOURCE_PATH="$1" + else + RESOURCE_PATH="${PODS_ROOT}/$1" + fi + if [[ ! -e "$RESOURCE_PATH" ]] ; then + cat << EOM +error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. +EOM + exit 1 + fi + case $RESOURCE_PATH in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.framework) + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true + xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + *) + echo "$RESOURCE_PATH" || true + echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] +then + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "${PODS_ROOT}*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi diff --git a/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests-umbrella.h b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests-umbrella.h new file mode 100644 index 0000000..8febd22 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double Pods_LSCreditCardForm_TestsVersionNumber; +FOUNDATION_EXPORT const unsigned char Pods_LSCreditCardForm_TestsVersionString[]; + diff --git a/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests.debug.xcconfig b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests.debug.xcconfig new file mode 100644 index 0000000..524a128 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests.debug.xcconfig @@ -0,0 +1,8 @@ +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LSCreditCardForm" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/LSCreditCardForm/LSCreditCardForm.framework/Headers" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests.modulemap b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests.modulemap new file mode 100644 index 0000000..d0056db --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests.modulemap @@ -0,0 +1,6 @@ +framework module Pods_LSCreditCardForm_Tests { + umbrella header "Pods-LSCreditCardForm_Tests-umbrella.h" + + export * + module * { export * } +} diff --git a/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests.release.xcconfig b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests.release.xcconfig new file mode 100644 index 0000000..524a128 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LSCreditCardForm_Tests/Pods-LSCreditCardForm_Tests.release.xcconfig @@ -0,0 +1,8 @@ +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LSCreditCardForm" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/LSCreditCardForm/LSCreditCardForm.framework/Headers" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/LSCreditCardForm.podspec b/LSCreditCardForm.podspec index 0f5db52..5d8ff97 100644 --- a/LSCreditCardForm.podspec +++ b/LSCreditCardForm.podspec @@ -7,36 +7,26 @@ # Pod::Spec.new do |s| - s.name = 'LSCreditCardForm' - s.version = '0.1.0' - s.summary = 'A short description of LSCreditCardForm.' - -# This description is used to generate tags and improve search results. -# * Think: What does it do? Why did you write it? What is the focus? -# * Try to keep it short, snappy and to the point. -# * Write the description between the DESC delimiters below. -# * Finally, don't worry about the indent, CocoaPods strips it! - - s.description = <<-DESC -TODO: Add long description of the pod here. - DESC - - s.homepage = 'https://github.com/lopdo/LSCreditCardForm' - # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' - s.license = { :type => 'MIT', :file => 'LICENSE' } - s.author = { 'lopdo' => 'lopenka@gmail.com' } - s.source = { :git => 'https://github.com/lopdo/LSCreditCardForm.git', :tag => s.version.to_s } - # s.social_media_url = 'https://twitter.com/' - - s.ios.deployment_target = '8.0' - - s.source_files = 'LSCreditCardForm/Classes/**/*' - - # s.resource_bundles = { - # 'LSCreditCardForm' => ['LSCreditCardForm/Assets/*.png'] - # } - - # s.public_header_files = 'Pod/Classes/**/*.h' - # s.frameworks = 'UIKit', 'MapKit' - # s.dependency 'AFNetworking', '~> 2.3' +s.name = 'LSCreditCardForm' +s.version = '1.0.0' +s.summary = 'Simple and engaging credit card form' + +s.description = <<-DESC +Offer your users engaging way how to enter credit card detail. Task that is usually boring and bothersome can be lightened by presenting it in visually interesting way +DESC + +s.homepage = 'https://github.com/lopdo/LSCreditCardForm' +s.license = { :type => 'MIT', :file => 'LICENSE' } +s.author = { 'lopdo' => 'lopenka@gmail.com' } +s.source = { :git => 'https://github.com/lopdo/LSCreditCardForm.git', :tag => s.version.to_s } + +s.ios.deployment_target = '8.0' + +s.source_files = 'LSCreditCardForm/Classes/**/*' + +s.resource_bundles = { +'LSCreditCardForm' => ['LSCreditCardForm/Assets/**/*'] +} + end + diff --git a/LSCreditCardForm/Assets/CreditCard.ttf b/LSCreditCardForm/Assets/CreditCard.ttf new file mode 100644 index 0000000..00abec8 Binary files /dev/null and b/LSCreditCardForm/Assets/CreditCard.ttf differ diff --git a/LSCreditCardForm/Assets/Images.xcassets/Contents.json b/LSCreditCardForm/Assets/Images.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/LSCreditCardForm/Assets/Images.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template.imageset/Blank card - Front.png b/LSCreditCardForm/Assets/Images.xcassets/cc_template.imageset/Blank card - Front.png new file mode 100644 index 0000000..12d99c7 Binary files /dev/null and b/LSCreditCardForm/Assets/Images.xcassets/cc_template.imageset/Blank card - Front.png differ diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template.imageset/Contents.json b/LSCreditCardForm/Assets/Images.xcassets/cc_template.imageset/Contents.json new file mode 100644 index 0000000..c0eb06d --- /dev/null +++ b/LSCreditCardForm/Assets/Images.xcassets/cc_template.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Blank card - Front.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_american_express.imageset/American express - Front.png b/LSCreditCardForm/Assets/Images.xcassets/cc_template_american_express.imageset/American express - Front.png new file mode 100644 index 0000000..ee956c5 Binary files /dev/null and b/LSCreditCardForm/Assets/Images.xcassets/cc_template_american_express.imageset/American express - Front.png differ diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_american_express.imageset/Contents.json b/LSCreditCardForm/Assets/Images.xcassets/cc_template_american_express.imageset/Contents.json new file mode 100644 index 0000000..d07de13 --- /dev/null +++ b/LSCreditCardForm/Assets/Images.xcassets/cc_template_american_express.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "American express - Front.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_american_express_back.imageset/American express - back.png b/LSCreditCardForm/Assets/Images.xcassets/cc_template_american_express_back.imageset/American express - back.png new file mode 100644 index 0000000..ea891b7 Binary files /dev/null and b/LSCreditCardForm/Assets/Images.xcassets/cc_template_american_express_back.imageset/American express - back.png differ diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_american_express_back.imageset/Contents.json b/LSCreditCardForm/Assets/Images.xcassets/cc_template_american_express_back.imageset/Contents.json new file mode 100644 index 0000000..f7ae649 --- /dev/null +++ b/LSCreditCardForm/Assets/Images.xcassets/cc_template_american_express_back.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "American express - back.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_back.imageset/Blank card - back.png b/LSCreditCardForm/Assets/Images.xcassets/cc_template_back.imageset/Blank card - back.png new file mode 100644 index 0000000..8139b2f Binary files /dev/null and b/LSCreditCardForm/Assets/Images.xcassets/cc_template_back.imageset/Blank card - back.png differ diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_back.imageset/Contents.json b/LSCreditCardForm/Assets/Images.xcassets/cc_template_back.imageset/Contents.json new file mode 100644 index 0000000..b540942 --- /dev/null +++ b/LSCreditCardForm/Assets/Images.xcassets/cc_template_back.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Blank card - back.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_dinners_club.imageset/Contents.json b/LSCreditCardForm/Assets/Images.xcassets/cc_template_dinners_club.imageset/Contents.json new file mode 100644 index 0000000..f89c1b1 --- /dev/null +++ b/LSCreditCardForm/Assets/Images.xcassets/cc_template_dinners_club.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Diners club - Front.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_dinners_club.imageset/Diners club - Front.png b/LSCreditCardForm/Assets/Images.xcassets/cc_template_dinners_club.imageset/Diners club - Front.png new file mode 100644 index 0000000..cbf3021 Binary files /dev/null and b/LSCreditCardForm/Assets/Images.xcassets/cc_template_dinners_club.imageset/Diners club - Front.png differ diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_dinners_club_back.imageset/Contents.json b/LSCreditCardForm/Assets/Images.xcassets/cc_template_dinners_club_back.imageset/Contents.json new file mode 100644 index 0000000..b2257e0 --- /dev/null +++ b/LSCreditCardForm/Assets/Images.xcassets/cc_template_dinners_club_back.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Diners club- back.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_dinners_club_back.imageset/Diners club- back.png b/LSCreditCardForm/Assets/Images.xcassets/cc_template_dinners_club_back.imageset/Diners club- back.png new file mode 100644 index 0000000..e7938b6 Binary files /dev/null and b/LSCreditCardForm/Assets/Images.xcassets/cc_template_dinners_club_back.imageset/Diners club- back.png differ diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_discover.imageset/Contents.json b/LSCreditCardForm/Assets/Images.xcassets/cc_template_discover.imageset/Contents.json new file mode 100644 index 0000000..ebfff0e --- /dev/null +++ b/LSCreditCardForm/Assets/Images.xcassets/cc_template_discover.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Discover - Front.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_discover.imageset/Discover - Front.png b/LSCreditCardForm/Assets/Images.xcassets/cc_template_discover.imageset/Discover - Front.png new file mode 100644 index 0000000..df52052 Binary files /dev/null and b/LSCreditCardForm/Assets/Images.xcassets/cc_template_discover.imageset/Discover - Front.png differ diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_discover_back.imageset/Contents.json b/LSCreditCardForm/Assets/Images.xcassets/cc_template_discover_back.imageset/Contents.json new file mode 100644 index 0000000..3c5da98 --- /dev/null +++ b/LSCreditCardForm/Assets/Images.xcassets/cc_template_discover_back.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Discover - Back.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_discover_back.imageset/Discover - Back.png b/LSCreditCardForm/Assets/Images.xcassets/cc_template_discover_back.imageset/Discover - Back.png new file mode 100644 index 0000000..ec8e3c1 Binary files /dev/null and b/LSCreditCardForm/Assets/Images.xcassets/cc_template_discover_back.imageset/Discover - Back.png differ diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_enroute.imageset/Contents.json b/LSCreditCardForm/Assets/Images.xcassets/cc_template_enroute.imageset/Contents.json new file mode 100644 index 0000000..b5d0868 --- /dev/null +++ b/LSCreditCardForm/Assets/Images.xcassets/cc_template_enroute.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Enroute - Front.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_enroute.imageset/Enroute - Front.png b/LSCreditCardForm/Assets/Images.xcassets/cc_template_enroute.imageset/Enroute - Front.png new file mode 100644 index 0000000..17ac7f9 Binary files /dev/null and b/LSCreditCardForm/Assets/Images.xcassets/cc_template_enroute.imageset/Enroute - Front.png differ diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_enroute_back.imageset/Contents.json b/LSCreditCardForm/Assets/Images.xcassets/cc_template_enroute_back.imageset/Contents.json new file mode 100644 index 0000000..3283898 --- /dev/null +++ b/LSCreditCardForm/Assets/Images.xcassets/cc_template_enroute_back.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Enroute - back.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_enroute_back.imageset/Enroute - back.png b/LSCreditCardForm/Assets/Images.xcassets/cc_template_enroute_back.imageset/Enroute - back.png new file mode 100644 index 0000000..815f7d7 Binary files /dev/null and b/LSCreditCardForm/Assets/Images.xcassets/cc_template_enroute_back.imageset/Enroute - back.png differ diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_jcb.imageset/Contents.json b/LSCreditCardForm/Assets/Images.xcassets/cc_template_jcb.imageset/Contents.json new file mode 100644 index 0000000..d6072a1 --- /dev/null +++ b/LSCreditCardForm/Assets/Images.xcassets/cc_template_jcb.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "JCB - Front.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_jcb.imageset/JCB - Front.png b/LSCreditCardForm/Assets/Images.xcassets/cc_template_jcb.imageset/JCB - Front.png new file mode 100644 index 0000000..28e72fd Binary files /dev/null and b/LSCreditCardForm/Assets/Images.xcassets/cc_template_jcb.imageset/JCB - Front.png differ diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_jcb_back.imageset/Contents.json b/LSCreditCardForm/Assets/Images.xcassets/cc_template_jcb_back.imageset/Contents.json new file mode 100644 index 0000000..358cb47 --- /dev/null +++ b/LSCreditCardForm/Assets/Images.xcassets/cc_template_jcb_back.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "JCB - Back.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_jcb_back.imageset/JCB - Back.png b/LSCreditCardForm/Assets/Images.xcassets/cc_template_jcb_back.imageset/JCB - Back.png new file mode 100644 index 0000000..1d7c5da Binary files /dev/null and b/LSCreditCardForm/Assets/Images.xcassets/cc_template_jcb_back.imageset/JCB - Back.png differ diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_maestro.imageset/Contents.json b/LSCreditCardForm/Assets/Images.xcassets/cc_template_maestro.imageset/Contents.json new file mode 100644 index 0000000..0d1532f --- /dev/null +++ b/LSCreditCardForm/Assets/Images.xcassets/cc_template_maestro.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Meastro - Front.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_maestro.imageset/Meastro - Front.png b/LSCreditCardForm/Assets/Images.xcassets/cc_template_maestro.imageset/Meastro - Front.png new file mode 100644 index 0000000..06a4b70 Binary files /dev/null and b/LSCreditCardForm/Assets/Images.xcassets/cc_template_maestro.imageset/Meastro - Front.png differ diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_maestro_back.imageset/Contents.json b/LSCreditCardForm/Assets/Images.xcassets/cc_template_maestro_back.imageset/Contents.json new file mode 100644 index 0000000..754d98e --- /dev/null +++ b/LSCreditCardForm/Assets/Images.xcassets/cc_template_maestro_back.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Meastro - back.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_maestro_back.imageset/Meastro - back.png b/LSCreditCardForm/Assets/Images.xcassets/cc_template_maestro_back.imageset/Meastro - back.png new file mode 100644 index 0000000..fa4175d Binary files /dev/null and b/LSCreditCardForm/Assets/Images.xcassets/cc_template_maestro_back.imageset/Meastro - back.png differ diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_mastercard.imageset/Contents.json b/LSCreditCardForm/Assets/Images.xcassets/cc_template_mastercard.imageset/Contents.json new file mode 100644 index 0000000..2474cd5 --- /dev/null +++ b/LSCreditCardForm/Assets/Images.xcassets/cc_template_mastercard.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Mastercard - Front.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_mastercard.imageset/Mastercard - Front.png b/LSCreditCardForm/Assets/Images.xcassets/cc_template_mastercard.imageset/Mastercard - Front.png new file mode 100644 index 0000000..3e9aa8e Binary files /dev/null and b/LSCreditCardForm/Assets/Images.xcassets/cc_template_mastercard.imageset/Mastercard - Front.png differ diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_mastercard_back.imageset/Contents.json b/LSCreditCardForm/Assets/Images.xcassets/cc_template_mastercard_back.imageset/Contents.json new file mode 100644 index 0000000..e2b3b27 --- /dev/null +++ b/LSCreditCardForm/Assets/Images.xcassets/cc_template_mastercard_back.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Mastercard - Back.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_mastercard_back.imageset/Mastercard - Back.png b/LSCreditCardForm/Assets/Images.xcassets/cc_template_mastercard_back.imageset/Mastercard - Back.png new file mode 100644 index 0000000..d231fd5 Binary files /dev/null and b/LSCreditCardForm/Assets/Images.xcassets/cc_template_mastercard_back.imageset/Mastercard - Back.png differ diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_visa.imageset/Contents.json b/LSCreditCardForm/Assets/Images.xcassets/cc_template_visa.imageset/Contents.json new file mode 100644 index 0000000..3ffde9e --- /dev/null +++ b/LSCreditCardForm/Assets/Images.xcassets/cc_template_visa.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Visa Card - Front.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_visa.imageset/Visa Card - Front.png b/LSCreditCardForm/Assets/Images.xcassets/cc_template_visa.imageset/Visa Card - Front.png new file mode 100644 index 0000000..ee2dc9b Binary files /dev/null and b/LSCreditCardForm/Assets/Images.xcassets/cc_template_visa.imageset/Visa Card - Front.png differ diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_visa_back.imageset/Contents.json b/LSCreditCardForm/Assets/Images.xcassets/cc_template_visa_back.imageset/Contents.json new file mode 100644 index 0000000..9b271ec --- /dev/null +++ b/LSCreditCardForm/Assets/Images.xcassets/cc_template_visa_back.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Visa Card - Back.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/LSCreditCardForm/Assets/Images.xcassets/cc_template_visa_back.imageset/Visa Card - Back.png b/LSCreditCardForm/Assets/Images.xcassets/cc_template_visa_back.imageset/Visa Card - Back.png new file mode 100644 index 0000000..1a38c70 Binary files /dev/null and b/LSCreditCardForm/Assets/Images.xcassets/cc_template_visa_back.imageset/Visa Card - Back.png differ diff --git a/LSCreditCardForm/Assets/Images.xcassets/texture_emboss.imageset/Contents.json b/LSCreditCardForm/Assets/Images.xcassets/texture_emboss.imageset/Contents.json new file mode 100644 index 0000000..80c1e7e --- /dev/null +++ b/LSCreditCardForm/Assets/Images.xcassets/texture_emboss.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "texture_emboss.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/LSCreditCardForm/Assets/Images.xcassets/texture_emboss.imageset/texture_emboss.png b/LSCreditCardForm/Assets/Images.xcassets/texture_emboss.imageset/texture_emboss.png new file mode 100644 index 0000000..941912b Binary files /dev/null and b/LSCreditCardForm/Assets/Images.xcassets/texture_emboss.imageset/texture_emboss.png differ diff --git a/LSCreditCardForm/Classes/LSButtonsView.swift b/LSCreditCardForm/Classes/LSButtonsView.swift new file mode 100644 index 0000000..f69b083 --- /dev/null +++ b/LSCreditCardForm/Classes/LSButtonsView.swift @@ -0,0 +1,147 @@ +// +// LSButtonsView.swift +// LSCreditCardForm +// +// Created by Lope on 16/03/2018. +// + +import UIKit + +class LSButtonsView: UIView { + + weak var coordinator: LSViewsCoordinator! + weak var delegate: LSCreditCardFormDelegate? + + private var buttonPrev: UIButton! + private var buttonNext: UIButton! + + private var constraintNextFullWidth: NSLayoutConstraint! + private var constraintNextHalfWidth: NSLayoutConstraint! + private var constraintNextLeading: NSLayoutConstraint! + private var constraintPrevLeading: NSLayoutConstraint! + + private var currentFocus: CCTextField = .number + + init(coordinator: LSViewsCoordinator) { + super.init(frame: CGRect.zero) + + self.coordinator = coordinator + coordinator.viewButtons = self + + backgroundColor = UIColor(red: 120.0 / 255.0, green: 171.0 / 255.0, blue: 70.0 / 255.0, alpha: 1) + translatesAutoresizingMaskIntoConstraints = false + + buttonPrev = UIButton() + buttonPrev.translatesAutoresizingMaskIntoConstraints = false + buttonPrev.titleLabel?.font = LSCreditCardFormConfig.Buttons.font ?? UIFont.systemFont(ofSize: 16) + buttonPrev.setTitle("PREV", for: .normal) + buttonPrev.setTitleColor(LSCreditCardFormConfig.Buttons.prevTextColor ?? UIColor.white, for: .normal) + buttonPrev.backgroundColor = LSCreditCardFormConfig.Buttons.prevColor ?? UIColor.clear + buttonPrev.addTarget(self, action: #selector(onPrevPressed), for: .touchUpInside) + addSubview(buttonPrev) + + buttonNext = UIButton() + buttonNext.translatesAutoresizingMaskIntoConstraints = false + buttonNext.titleLabel?.font = LSCreditCardFormConfig.Buttons.font ?? UIFont.systemFont(ofSize: 16) + buttonNext.setTitle("NEXT", for: .normal) + buttonNext.setTitleColor(LSCreditCardFormConfig.Buttons.nextTextColor ?? UIColor.white, for: .normal) + buttonNext.backgroundColor = LSCreditCardFormConfig.Buttons.nextColor ?? UIColor.clear + buttonNext.addTarget(self, action: #selector(onNextPressed), for: .touchUpInside) + addSubview(buttonNext) + + let views: [String: Any] = ["prev": buttonPrev, + "next": buttonNext] + + addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:[prev][next]", options: [], metrics: nil, views: views)) + addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|[prev]|", options: [], metrics: nil, views: views)) + addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|[next]|", options: [], metrics: nil, views: views)) + + addConstraint(NSLayoutConstraint(item: buttonPrev, attribute: .width, relatedBy: .equal, toItem: self, attribute: .width, multiplier: 0.5, constant: 0)) + + constraintNextFullWidth = NSLayoutConstraint(item: buttonNext, attribute: .width, relatedBy: .equal, toItem: self, attribute: .width, multiplier: 1, constant: 0) + constraintNextFullWidth.priority = UILayoutPriority(500) + addConstraint(constraintNextFullWidth) + + constraintNextHalfWidth = NSLayoutConstraint(item: buttonNext, attribute: .width, relatedBy: .equal, toItem: self, attribute: .width, multiplier: 0.5, constant: 0) + constraintNextHalfWidth.priority = UILayoutPriority(100) + addConstraint(constraintNextHalfWidth) + + constraintPrevLeading = NSLayoutConstraint(item: self, attribute: .leading, relatedBy: .equal, toItem: buttonPrev, attribute: .leading, multiplier: 1, constant: 0) + constraintPrevLeading.priority = UILayoutPriority(100) + addConstraint(constraintPrevLeading) + + constraintNextLeading = NSLayoutConstraint(item: self, attribute: .leading, relatedBy: .equal, toItem: buttonNext, attribute: .leading, multiplier: 1, constant: 0) + constraintNextLeading.priority = UILayoutPriority(900) + addConstraint(constraintNextLeading) + } + + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + } + + func focusChanged(to field: CCTextField) { + switch field { + case .number: + constraintNextLeading.priority = UILayoutPriority(900) + constraintNextLeading.constant = 0 + constraintPrevLeading.priority = UILayoutPriority(100) + constraintNextFullWidth.priority = UILayoutPriority(900) + constraintNextHalfWidth.priority = UILayoutPriority(100) + case .cvv: + fallthrough + case .expiration: + fallthrough + case .name: + constraintNextLeading.priority = UILayoutPriority(100) + constraintNextLeading.constant = 0 + constraintPrevLeading.priority = UILayoutPriority(900) + constraintNextFullWidth.priority = UILayoutPriority(100) + constraintNextHalfWidth.priority = UILayoutPriority(900) + } + + setNeedsLayout() + + UIView.animate(withDuration: 0.2) { + if field == .name { + self.buttonNext.setTitle("DONE", for: .normal) + } else { + self.buttonNext.setTitle("NEXT", for: .normal) + } + self.layoutIfNeeded() + } + + currentFocus = field + } + + @objc func onPrevPressed() { + switch currentFocus { + case .expiration: + coordinator.changeActiveTextField(field: .number) + case .cvv: + coordinator.changeActiveTextField(field: .expiration) + case .name: + coordinator.changeActiveTextField(field: .cvv) + case .number: + // do nothing when we are on .number + break + } + } + + @objc func onNextPressed() { + switch currentFocus { + case .number: + coordinator.changeActiveTextField(field: .expiration) + case .expiration: + coordinator.changeActiveTextField(field: .cvv) + case .cvv: + coordinator.changeActiveTextField(field: .name) + case .name: + delegate?.didCompleteForm(creditCard: coordinator.creditCard) + break + } + } + + /*@objc func onDonePressed() { + delegate?.didCompleteForm(creditCard: coordinator.creditCard) + }*/ +} diff --git a/LSCreditCardForm/Classes/LSCreditCard.swift b/LSCreditCardForm/Classes/LSCreditCard.swift new file mode 100644 index 0000000..bb55dd0 --- /dev/null +++ b/LSCreditCardForm/Classes/LSCreditCard.swift @@ -0,0 +1,242 @@ +// +// LSCreditCard.swift +// LSCreditCardForm +// +// Created by Lope on 17/03/2018. +// + +import Foundation + +public class LSCreditCard { + + public var number: String = "" + public var expiration: String = "" + public var cvv: String = "" + public var cardHolderName: String = "" + + public var cardType: LSCreditCardType = .unknown +} + +public enum LSCreditCardType { + + case visa + case mastercard + case americanExpress + case dinersClub + case discover + case enRoute + case jcb + case maestro + + case unknown + + private func getImageNameFront() -> String { + switch self { + case .visa: return "cc_template_visa" + case .mastercard: return "cc_template_mastercard" + case .americanExpress: return "cc_template_american_express" + case .dinersClub: return "cc_template_dinners_club" + case .discover: return "cc_template_discover" + case .jcb: return "cc_template_jcb" + case .maestro: return "cc_template_maestro" + case .enRoute: return "cc_template_enroute" + case .unknown: return "cc_template" + } + } + + private func getImageNameBack() -> String { + switch self { + case .visa: return "cc_template_visa_back" + case .mastercard: return "cc_template_mastercard_back" + case .americanExpress: return "cc_template_american_express_back" + case .dinersClub: return "cc_template_dinners_club_back" + case .discover: return "cc_template_discover_back" + case .jcb: return "cc_template_jcb_back" + case .maestro: return "cc_template_maestro_back" + case .enRoute: return "cc_template_enroute_back" + case .unknown: return "cc_template_back" + } + } + + var imageFront: UIImage? { + get { + + let img: UIImage? + + switch self { + case .visa: img = LSCreditCardFormConfig.CreditCard.imgVisaFront + case .mastercard: img = LSCreditCardFormConfig.CreditCard.imgMastercardFront + case .americanExpress: img = LSCreditCardFormConfig.CreditCard.imgAmericanExpressFront + case .dinersClub: img = LSCreditCardFormConfig.CreditCard.imgDinersClubFront + case .discover: img = LSCreditCardFormConfig.CreditCard.imgDiscoverFront + case .jcb: img = LSCreditCardFormConfig.CreditCard.imgJCBFront + case .maestro: img = LSCreditCardFormConfig.CreditCard.imgMaestroFront + case .enRoute: img = LSCreditCardFormConfig.CreditCard.imgEnRouteFront + case .unknown: img = LSCreditCardFormConfig.CreditCard.imgUnknownFront + } + + return img ?? UIImage(named: getImageNameFront(), in: Bundle(for: LSCreditCardView.self), compatibleWith: nil) + } + } + + var imageBack: UIImage? { + get { + + let img: UIImage? + + switch self { + case .visa: img = LSCreditCardFormConfig.CreditCard.imgVisaBack + case .mastercard: img = LSCreditCardFormConfig.CreditCard.imgMastercardBack + case .americanExpress: img = LSCreditCardFormConfig.CreditCard.imgAmericanExpressBack + case .dinersClub: img = LSCreditCardFormConfig.CreditCard.imgDinersClubBack + case .discover: img = LSCreditCardFormConfig.CreditCard.imgDiscoverBack + case .jcb: img = LSCreditCardFormConfig.CreditCard.imgJCBBack + case .maestro: img = LSCreditCardFormConfig.CreditCard.imgMaestroBack + case .enRoute: img = LSCreditCardFormConfig.CreditCard.imgEnRouteBack + case .unknown: img = LSCreditCardFormConfig.CreditCard.imgUnknownBack + } + + return img ?? UIImage(named: getImageNameBack(), in: Bundle(for: LSCreditCardView.self), compatibleWith: nil) + } + } + + var regexDetection: NSRegularExpression { + get { + switch self { + case .visa: return try! NSRegularExpression(pattern: "^4") + case .mastercard: return try! NSRegularExpression(pattern: "^(5[1-5]|222[1-9]|22[3-9]|2[3-6]|27[01]|2720)") + case .americanExpress: return try! NSRegularExpression(pattern: "^3[47]") + case .dinersClub: return try! NSRegularExpression(pattern: "^3(?:0[0-59]{1}|[689])") + case .discover: return try! NSRegularExpression(pattern: "^(6011|65|64[4-9]|62212[6-9]|6221[3-9]|622[2-8]|6229[01]|62292[0-5])") + case .jcb: return try! NSRegularExpression(pattern: "^(?:2131|1800|35)") + case .maestro: return try! NSRegularExpression(pattern: "^(5[06789]|6)") + case .enRoute: return try! NSRegularExpression(pattern: "^(2014|2149)") + case .unknown: return try! NSRegularExpression(pattern: "") + } + } + } + + var regexValidation: NSRegularExpression { + get { + switch self { + case .visa: return try! NSRegularExpression(pattern: "^4[0-9]{6,}$") + case .mastercard: return try! NSRegularExpression(pattern: "^(5[1-5]|222[1-9]|22[3-9]|2[3-6]|27[01]|2720)[0-9]{0,}$") + case .americanExpress: return try! NSRegularExpression(pattern: "^3[47][0-9]{0,}$") + case .dinersClub: return try! NSRegularExpression(pattern: "^3(?:0[0-59]{1}|[689])[0-9]{0,}$") + case .discover: return try! NSRegularExpression(pattern: "^(6011|65|64[4-9]|62212[6-9]|6221[3-9]|622[2-8]|6229[01]|62292[0-5])[0-9]{0,}$") + case .jcb: return try! NSRegularExpression(pattern: "^(?:2131|1800|35)[0-9]{0,}$") + case .maestro: return try! NSRegularExpression(pattern: "^(5[06789]|6)[0-9]{0,}$") + case .enRoute: return try! NSRegularExpression(pattern: "^(2014|2149)[0-9]*$") + case .unknown: return try! NSRegularExpression(pattern: "(?!.*)") // does not match anything + } + } + } + + var maxDigits: Int { + get { + switch self { + case .visa: return 19 + case .mastercard: return 16 + case .americanExpress: return 15 + case .dinersClub: return 14 + case .discover: return 16 + case .jcb: return 19 + case .maestro: return 19 + case .enRoute: return 15 + case .unknown: return 16 + } + } + } + + var usualDigitsCount: Int { + get { + switch self { + case .visa: return LSCreditCardFormConfig.CreditCard.softLimitVisaTo16Digits ? 16 : maxDigits + default: return maxDigits + } + } + } + + var getFormatter: ((String, Int) -> (String, Int))? { + get { + switch self { + case .visa: + fallthrough + case .discover: + fallthrough + case .mastercard: + fallthrough + case .jcb: + fallthrough + case .maestro: + return LSCreditCardType.format4444(cardNumber:cursorPosition:) + case .americanExpress: + fallthrough + case .dinersClub: + fallthrough + case .enRoute: + return LSCreditCardType.format465(cardNumber:cursorPosition:) + case .unknown: + return nil + } + } + } + + static func getType(cardNumber: String) -> LSCreditCardType { + + let trimmedNumber = cardNumber.replacingOccurrences(of: " ", with: "") + + let types: [LSCreditCardType] + if LSCreditCardFormConfig.CreditCard.supportedTypes != nil && !LSCreditCardFormConfig.CreditCard.supportedTypes!.isEmpty { + types = LSCreditCardFormConfig.CreditCard.supportedTypes! + } else { + types = [.visa, .mastercard, .americanExpress, .dinersClub, .discover, .jcb, .maestro, .enRoute] + } + + for t in types { + let results = t.regexDetection.matches(in: trimmedNumber, + range: NSRange(trimmedNumber.startIndex..., in: trimmedNumber)) + + if results.count > 0 { + return t + } + } + + return .unknown + } + + private static func format4444(cardNumber: String, cursorPosition: Int) -> (String, Int) { + var numberWithSpaces = "" + var newCursorPosition = cursorPosition + + for i in 0.. 0 && (i % 4) == 0 { + numberWithSpaces.append(" ") + if i < cursorPosition { + newCursorPosition += 1 + } + } + numberWithSpaces.append(cardNumber[cardNumber.index(cardNumber.startIndex, offsetBy: i)]) + } + + return (numberWithSpaces, newCursorPosition) + } + + private static func format465(cardNumber: String, cursorPosition: Int) -> (String, Int) { + var numberWithSpaces = "" + var newCursorPosition = cursorPosition + + for i in 0..? + let success = CTFontManagerRegisterGraphicsFont(font, &error) + guard success else { + print("Error registering font: maybe it was already registered.") + return + } + } + + static func convertTextToSmallNumbers(text: String) -> String { + var result = "" + let mapping: [Character: Character] = ["1": "a", "2": "b", "3": "c", "4": "d", "5": "e", "6": "f", "7": "g", "8": "h", "9": "i", "0": "j"] + for i in 0.. UIImage? { + UIGraphicsBeginImageContextWithOptions(size, false, 0) + let rect = CGRect(x: 0, y: 0, width: size.width, height: size.height) + string.draw(with: rect, options: .usesLineFragmentOrigin, attributes: attributes, context: nil) + let image = UIGraphicsGetImageFromCurrentImageContext() + UIGraphicsEndImageContext() + return image + } + + func applyEmboss() -> UIImage { + + let embossTexture = UIImage(named: "texture_emboss", in: Bundle(for: LSCreditCardView.self), compatibleWith: nil)! + + // Create filters + guard let heightMapFilter = CIFilter(name: "CIHeightFieldFromMask") else { + return self + } + guard let shadedMaterialFilter = CIFilter(name: "CIShadedMaterial") else { + return self + } + + // Filters chain + heightMapFilter.setValue(CIImage(image: self), + forKey: kCIInputImageKey) + + guard let heightMapFilterOutput = heightMapFilter.outputImage else { + return self + } + + shadedMaterialFilter.setValue(heightMapFilterOutput, + forKey: kCIInputImageKey) + shadedMaterialFilter.setValue(CIImage(image: embossTexture), + forKey: "inputShadingImage") + // Catch output + guard let filteredImage = shadedMaterialFilter.outputImage else { + return self + } + + let img = UIImage(ciImage: filteredImage, scale: UIScreen.main.scale, orientation: .up) + return img + + } +} + diff --git a/LSCreditCardForm/Classes/LSCreditCardFormConfig.swift b/LSCreditCardForm/Classes/LSCreditCardFormConfig.swift new file mode 100644 index 0000000..d56bff8 --- /dev/null +++ b/LSCreditCardForm/Classes/LSCreditCardFormConfig.swift @@ -0,0 +1,79 @@ +// +// LSCreditCardFormConfig.swift +// LSCreditCardForm +// +// Created by Lope on 04/04/2018. +// + +import Foundation + +public struct LSCreditCardFormConfig { + + public struct CreditCard { + + // While Visa card numbers have usually 16 digits, they can officially go up to 19. + // Because of this, we lose automatic jump to next field upon entering 16th digit. + // If you still want that functionality, set the property to true. Users will still + // be able to go back and enter rest of digits if they happen to have 19 digit CC + public static var softLimitVisaTo16Digits = false + + // Controls emboss effect on CC number, expiration date and cardholder name values + public static var applyEmboss = true + + // custom CC image overrides + public static var imgVisaFront: UIImage? = nil + public static var imgVisaBack: UIImage? = nil + public static var imgMastercardFront: UIImage? = nil + public static var imgMastercardBack: UIImage? = nil + public static var imgMaestroFront: UIImage? = nil + public static var imgMaestroBack: UIImage? = nil + public static var imgAmericanExpressFront: UIImage? = nil + public static var imgAmericanExpressBack: UIImage? = nil + public static var imgDinersClubFront: UIImage? = nil + public static var imgDinersClubBack: UIImage? = nil + public static var imgDiscoverFront: UIImage? = nil + public static var imgDiscoverBack: UIImage? = nil + public static var imgJCBFront: UIImage? = nil + public static var imgJCBBack: UIImage? = nil + public static var imgEnRouteFront: UIImage? = nil + public static var imgEnRouteBack: UIImage? = nil + public static var imgUnknownFront: UIImage? = nil + public static var imgUnknownBack: UIImage? = nil + + // Customization of view sitting behing credit card, use backgroundView property + // if you require something other than solid color (which can be set using backgroundColor) + public static var backgroundView: UIView? = nil + public static var backgroundColor: UIColor? = nil + + // Limit CC detection to following CC types only. User will still be able to enter + // any credit card number, but image will not update if CC type is not in the list + // To support all types, set property to nil + public static var supportedTypes: [LSCreditCardType]? = nil + } + + public struct TextFields { + + public static var font: UIFont? = nil + public static var textColor: UIColor? = nil + public static var backgroundColor: UIColor? = nil + + } + + public struct TextFieldLabels { + + public static var font: UIFont? = nil + public static var textColorActive: UIColor? = nil + public static var textColorInactive: UIColor? = nil + + } + + public struct Buttons { + + public static var font: UIFont? = nil + public static var prevColor: UIColor? = nil + public static var nextColor: UIColor? = nil + public static var prevTextColor: UIColor? = nil + public static var nextTextColor: UIColor? = nil + + } +} diff --git a/LSCreditCardForm/Classes/LSCreditCardFormView.swift b/LSCreditCardForm/Classes/LSCreditCardFormView.swift new file mode 100644 index 0000000..29d7808 --- /dev/null +++ b/LSCreditCardForm/Classes/LSCreditCardFormView.swift @@ -0,0 +1,66 @@ +// +// LSCreditCardFormView.swift +// LSCreditCardForm +// +// Created by Lope on 16/03/2018. +// + +import UIKit + +public protocol LSCreditCardFormDelegate: AnyObject { + + func didCompleteForm(creditCard: LSCreditCard) + +} + +public class LSCreditCardFormView: UIView { + + var viewTextFields: LSTextFieldsView! + var viewCreditCardWrapper: LSCreditCardWrapperView! + var viewButtons: LSButtonsView! + + public weak var delegate: LSCreditCardFormDelegate? { + didSet { + viewButtons.delegate = delegate + } + } + + private var coordinator: LSViewsCoordinator! + + public override init(frame: CGRect) { + super.init(frame: frame) + + createViews() + } + + public required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + + createViews() + } + + private func createViews() { + translatesAutoresizingMaskIntoConstraints = false + + coordinator = LSViewsCoordinator() + + viewTextFields = LSTextFieldsView(coordinator: coordinator) + addSubview(viewTextFields) + + viewCreditCardWrapper = LSCreditCardWrapperView() + addSubview(viewCreditCardWrapper) + coordinator.viewCreditCard = viewCreditCardWrapper.viewCC + + viewButtons = LSButtonsView(coordinator: coordinator) + addSubview(viewButtons) + + let views: [String: Any] = ["textFields": viewTextFields, + "ccWrapper": viewCreditCardWrapper, + "buttons": viewButtons] + + addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[textFields]|", options: [], metrics: nil, views: views)) + addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[ccWrapper]|", options: [], metrics: nil, views: views)) + addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[buttons]|", options: [], metrics: nil, views: views)) + addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|[ccWrapper][textFields(70)][buttons(50)]|", options: [], metrics: nil, views: views)) + } +} diff --git a/LSCreditCardForm/Classes/LSCreditCardView.swift b/LSCreditCardForm/Classes/LSCreditCardView.swift new file mode 100644 index 0000000..710dac0 --- /dev/null +++ b/LSCreditCardForm/Classes/LSCreditCardView.swift @@ -0,0 +1,285 @@ +// +// LSCreditCardView.swift +// LSCreditCardForm +// +// Created by Lope on 16/03/2018. +// + +import UIKit + +class LSCreditCardView: UIView { + + private var imgViewBackground: UIImageView! + private var imgViewNumber: UIImageView! + private var imgViewExpiration: UIImageView! + private var imgViewName: UIImageView! + private var lblCVV: UILabel! + + private var lblCardHolderTitle: UILabel! + private var lblExpirationTitle: UILabel! + + private var constraintNumberLeading: NSLayoutConstraint! + private var constraintNumberTop: NSLayoutConstraint! + private var constraintNameLeading: NSLayoutConstraint! + private var constraintNameTop: NSLayoutConstraint! + private var constraintExpirationLeading: NSLayoutConstraint! + private var constraintExpirationTop: NSLayoutConstraint! + private var constraintNameTitleLeading: NSLayoutConstraint! + private var constraintNameTitleTop: NSLayoutConstraint! + private var constraintExpirationTitleLeading: NSLayoutConstraint! + private var constraintExpirationTitleTop: NSLayoutConstraint! + private var constraintCVVTop: NSLayoutConstraint! + private var constraintCVVLeading: NSLayoutConstraint! + private var constraintCVVWidth: NSLayoutConstraint! + private var constraintCVVHeight: NSLayoutConstraint! + + private var resizeRatio: CGFloat = 1 + + private var cardType: LSCreditCardType = .unknown + + private var facingFront = true + private var inTransition = false + + + init() { + super.init(frame: CGRect.zero) + + translatesAutoresizingMaskIntoConstraints = false + + imgViewBackground = UIImageView(image: UIImage(named: "cc_template", in: Bundle(for: LSCreditCardView.self), compatibleWith: nil)!) + imgViewBackground.translatesAutoresizingMaskIntoConstraints = false + addSubview(imgViewBackground) + + addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[imgView]|", options: [], metrics: nil, views: ["imgView": imgViewBackground])) + addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|[imgView]|", options: [], metrics: nil, views: ["imgView": imgViewBackground])) + + addConstraint(NSLayoutConstraint(item: self, attribute: .height, relatedBy: .equal, toItem: self, attribute: .width, multiplier: 0.63, constant: 0)) + + LSCreditCardFont.registerFont() + + imgViewNumber = UIImageView() + imgViewNumber.translatesAutoresizingMaskIntoConstraints = false + addSubview(imgViewNumber) + + constraintNumberLeading = NSLayoutConstraint(item: imgViewNumber, attribute: .leading, relatedBy: .equal, toItem: self, attribute: .leading, multiplier: 1, constant: 32) + constraintNumberTop = NSLayoutConstraint(item: imgViewNumber, attribute: .top, relatedBy: .equal, toItem: self, attribute: .top, multiplier: 1, constant: 96) + addConstraint(constraintNumberLeading) + addConstraint(constraintNumberTop) + + imgViewExpiration = UIImageView() + imgViewExpiration.translatesAutoresizingMaskIntoConstraints = false + addSubview(imgViewExpiration) + + constraintExpirationLeading = NSLayoutConstraint(item: imgViewExpiration, attribute: .leading, relatedBy: .equal, toItem: self, attribute: .leading, multiplier: 1, constant: 244) + constraintExpirationTop = NSLayoutConstraint(item: imgViewExpiration, attribute: .top, relatedBy: .equal, toItem: self, attribute: .top, multiplier: 1, constant: 166) + addConstraint(constraintExpirationLeading) + addConstraint(constraintExpirationTop) + + imgViewName = UIImageView() + imgViewName.translatesAutoresizingMaskIntoConstraints = false + addSubview(imgViewName) + + constraintNameLeading = NSLayoutConstraint(item: imgViewName, attribute: .leading, relatedBy: .equal, toItem: self, attribute: .leading, multiplier: 1, constant: 32) + constraintNameTop = NSLayoutConstraint(item: imgViewName, attribute: .top, relatedBy: .equal, toItem: self, attribute: .top, multiplier: 1, constant: 166) + addConstraint(constraintNameLeading) + addConstraint(constraintNameTop) + + let cvvWrapView = UIView() + cvvWrapView.translatesAutoresizingMaskIntoConstraints = false + cvvWrapView.backgroundColor = UIColor.clear + addSubview(cvvWrapView) + + constraintCVVLeading = NSLayoutConstraint(item: cvvWrapView, attribute: .leading, relatedBy: .equal, toItem: self, attribute: .leading, multiplier: 1, constant: 24) + constraintCVVTop = NSLayoutConstraint(item: cvvWrapView, attribute: .top, relatedBy: .equal, toItem: self, attribute: .top, multiplier: 1, constant: 100) + addConstraint(constraintCVVLeading) + addConstraint(constraintCVVTop) + + constraintCVVWidth = NSLayoutConstraint(item: cvvWrapView, attribute: .width, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1, constant: 32) + constraintCVVHeight = NSLayoutConstraint(item: cvvWrapView, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1, constant: 16) + cvvWrapView.addConstraint(constraintCVVWidth) + cvvWrapView.addConstraint(constraintCVVHeight) + + lblCVV = UILabel() + lblCVV.translatesAutoresizingMaskIntoConstraints = false + lblCVV.font = UIFont.systemFont(ofSize: 14) + lblCVV.textColor = UIColor.black + lblCVV.text = "" + lblCVV.transform = CGAffineTransform(a: 1, b: 0, c: -0.25, d: 1, tx: 0, ty: 0).scaledBy(x: -0.8, y: 1) + lblCVV.isHidden = true + cvvWrapView.addSubview(lblCVV) + + cvvWrapView.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[lbl]|", options: [], metrics: nil, views: ["lbl": lblCVV])) + cvvWrapView.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|[lbl]|", options: [], metrics: nil, views: ["lbl": lblCVV])) + + lblCardHolderTitle = UILabel() + lblCardHolderTitle.translatesAutoresizingMaskIntoConstraints = false + lblCardHolderTitle.font = UIFont.systemFont(ofSize: 10) + lblCardHolderTitle.textColor = UIColor.white + lblCardHolderTitle.text = "CARD HOLDER" + addSubview(lblCardHolderTitle) + + lblExpirationTitle = UILabel() + lblExpirationTitle.translatesAutoresizingMaskIntoConstraints = false + lblExpirationTitle.font = UIFont.systemFont(ofSize: 10) + lblExpirationTitle.textColor = UIColor.white + lblExpirationTitle.text = "EXPIRES" + addSubview(lblExpirationTitle) + + constraintNameTitleLeading = NSLayoutConstraint(item: lblCardHolderTitle, attribute: .leading, relatedBy: .equal, toItem: self, attribute: .leading, multiplier: 1, constant: 32) + constraintNameTitleTop = NSLayoutConstraint(item: lblCardHolderTitle, attribute: .top, relatedBy: .equal, toItem: self, attribute: .top, multiplier: 1, constant: 148) + addConstraint(constraintNameTitleLeading) + addConstraint(constraintNameTitleTop) + + constraintExpirationTitleLeading = NSLayoutConstraint(item: lblExpirationTitle, attribute: .leading, relatedBy: .equal, toItem: self, attribute: .leading, multiplier: 1, constant: 244) + constraintExpirationTitleTop = NSLayoutConstraint(item: lblExpirationTitle, attribute: .top, relatedBy: .equal, toItem: self, attribute: .top, multiplier: 1, constant: 148) + addConstraint(constraintExpirationTitleLeading) + addConstraint(constraintExpirationTitleTop) + } + + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + } + + override func layoutSubviews() { + super.layoutSubviews() + + resizeRatio = self.frame.width / 333 + + constraintNumberLeading.constant = 32 * resizeRatio + constraintNumberTop.constant = 96 * resizeRatio + constraintExpirationLeading.constant = 244 * resizeRatio + constraintExpirationTop.constant = 166 * resizeRatio + constraintNameLeading.constant = 32 * resizeRatio + constraintNameTop.constant = 166 * resizeRatio + constraintCVVLeading.constant = 24 * resizeRatio + constraintCVVTop.constant = 100 * resizeRatio + constraintCVVWidth.constant = 32 * resizeRatio + constraintCVVHeight.constant = 16 * resizeRatio + constraintNameTitleLeading.constant = 32 * resizeRatio + constraintNameTitleTop.constant = 148 * resizeRatio + constraintExpirationTitleLeading.constant = 244 * resizeRatio + constraintExpirationTitleTop.constant = 148 * resizeRatio + + lblCVV.font = UIFont.systemFont(ofSize: 14 * resizeRatio) + lblCardHolderTitle.font = UIFont.systemFont(ofSize: 10 * resizeRatio) + lblExpirationTitle.font = UIFont.systemFont(ofSize: 10 * resizeRatio) + + updateValues(creditCard: nil) + } + + func flipCard(toFront: Bool) { + + if inTransition { + // if we get flip request while we are transition to different orientation, we reset animation + // otherwise we let it play out + // facingFront contains old value until animation finishes, so we reset it only if we want to flip + // to orientation we are currently transitioning from + if toFront == facingFront { + // finish animation by reseting tranform to target transform + layer.transform = CATransform3DMakeRotation(self.facingFront ? CGFloat.pi : 0, 0.0, 1.0, 0.0) + + facingFront = !facingFront + inTransition = false + + updateCardContent() + + } else { + return + } + } + + if toFront == facingFront { + return + } + + inTransition = true + + UIView.animate(withDuration: 1.0, delay: 0, usingSpringWithDamping: 0.75, initialSpringVelocity: 0, options: [], animations: { + + var transformPerspective = CATransform3DIdentity + transformPerspective.m34 = -1.0 / 500 + self.layer.transform = CATransform3DRotate(transformPerspective, self.facingFront ? CGFloat.pi : 0, 0.0, 1.0, 0.0) + + }) { finished in + if finished { + self.inTransition = false + self.facingFront = !self.facingFront + } + } + + delay(0.15) { + self.updateCardContent() + } + } + + private func updateCardContent() { + let currentlyFacingFront: Bool + if inTransition { + currentlyFacingFront = !facingFront + } else { + currentlyFacingFront = facingFront + } + + if currentlyFacingFront { + imgViewBackground.image = cardType.imageFront + imgViewBackground.layer.transform = CATransform3DMakeRotation(0, 0.0, 1.0, 0.0) + } else { + imgViewBackground.image = cardType.imageBack + imgViewBackground.layer.transform = CATransform3DMakeRotation(CGFloat.pi * 1, 0.0, 1.0, 0.0) + } + + lblCVV.isHidden = currentlyFacingFront + imgViewNumber.isHidden = !currentlyFacingFront + imgViewExpiration.isHidden = !currentlyFacingFront + imgViewName.isHidden = !currentlyFacingFront + + lblExpirationTitle.isHidden = !currentlyFacingFront + lblCardHolderTitle.isHidden = !currentlyFacingFront + } + + private func delay(_ delayInSeconds:Double, closure:@escaping ()->()) { + DispatchQueue.main.asyncAfter( + deadline: DispatchTime.now() + Double(Int64(delayInSeconds * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC), execute: closure) + } + + func updateValues(creditCard: LSCreditCard?) { + + if let card = creditCard { + lblCVV.text = card.cvv + + imgViewNumber.image = createImage(from: card.number, size: CGSize(width: 250, height: 16)) + imgViewExpiration.image = createImage(from: LSCreditCardFont.convertTextToSmallNumbers(text: card.expiration), size: CGSize(width: 40, height: 16)) + imgViewName.image = createImage(from: LSCreditCardFont.convertTextToSmallNumbers(text: card.cardHolderName.uppercased()), size: CGSize(width: 200, height: 16)) + + cardType = card.cardType + } else { + lblCVV.text = "" + + imgViewNumber.image = createImage(from: "", size: CGSize(width: 250, height: 16)) + imgViewExpiration.image = createImage(from: "", size: CGSize(width: 40, height: 16)) + imgViewName.image = createImage(from: "", size: CGSize(width: 200, height: 16)) + + cardType = .unknown + } + + updateCardContent() + } + + func createImage(from string: String, size: CGSize) -> UIImage? { + + let stringAttributes: [NSAttributedStringKey: Any] = [.font: UIFont(name: "Credit Card", size: 13 * resizeRatio)!, + .foregroundColor: UIColor.white] + + let image = UIImage.image(from: string, attributes: stringAttributes, size: size) + + #if targetEnvironment(simulator) + return image + #else + if LSCreditCardFormConfig.CreditCard.applyEmboss { + return image?.applyEmboss() + } else { + return image + } + #endif + } +} diff --git a/LSCreditCardForm/Classes/LSCreditCardWrapperView.swift b/LSCreditCardForm/Classes/LSCreditCardWrapperView.swift new file mode 100644 index 0000000..534db23 --- /dev/null +++ b/LSCreditCardForm/Classes/LSCreditCardWrapperView.swift @@ -0,0 +1,43 @@ +// +// LSCreditCardWrapperView.swift +// LSCreditCardForm +// +// Created by Lope on 16/03/2018. +// + +import UIKit + +class LSCreditCardWrapperView: UIView { + + var viewCC: LSCreditCardView! + + init() { + super.init(frame: CGRect.zero) + + translatesAutoresizingMaskIntoConstraints = false + + if let bgView = LSCreditCardFormConfig.CreditCard.backgroundView { + bgView.translatesAutoresizingMaskIntoConstraints = false + bgView.layer.zPosition = -100000 + addSubview(bgView) + + addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|[bgView]|", options: [], metrics: nil, views: ["bgView": bgView])) + addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[bgView]|", options: [], metrics: nil, views: ["bgView": bgView])) + + } else { + backgroundColor = LSCreditCardFormConfig.CreditCard.backgroundColor ?? UIColor.lightGray + } + + viewCC = LSCreditCardView() + addSubview(viewCC) + + addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|->=30-[viewCC]->=30-|", options: [], metrics: nil, views: ["viewCC": viewCC])) + addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|->=30-[viewCC]->=30-|", options: [], metrics: nil, views: ["viewCC": viewCC])) + addConstraint(NSLayoutConstraint(item: self, attribute: .centerX, relatedBy: .equal, toItem: viewCC, attribute: .centerX, multiplier: 1, constant: 0)) + addConstraint(NSLayoutConstraint(item: self, attribute: .centerY, relatedBy: .equal, toItem: viewCC, attribute: .centerY, multiplier: 1, constant: 0)) + } + + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + } +} diff --git a/LSCreditCardForm/Classes/LSTextFieldsView.swift b/LSCreditCardForm/Classes/LSTextFieldsView.swift new file mode 100644 index 0000000..446f2d7 --- /dev/null +++ b/LSCreditCardForm/Classes/LSTextFieldsView.swift @@ -0,0 +1,365 @@ +// +// LSTextFieldsView.swift +// LSCreditCardForm +// +// Created by Lope on 16/03/2018. +// + +import UIKit + +class LSTextFieldsView: UIView { + + private var scrollView: UIScrollView! + + private var tfNumber: UITextField! + private var tfExpiration: UITextField! + private var tfCardHolderName: UITextField! + private var tfCVV: UITextField! + + private var lblNumber: UILabel! + private var lblExpiration: UILabel! + private var lblCardHolderName: UILabel! + private var lblCVV: UILabel! + + // CC formatter helpers + private var previousNumberTextFieldContent: String = "" + private var previousNumberSelection: UITextRange? + private var previousExpirationTextFieldContent: String = "" + private var previousExpirationSelection: UITextRange? + + weak var coordinator: LSViewsCoordinator! + + private var changingResponderFromCode: Bool = false + + init(coordinator: LSViewsCoordinator) { + super.init(frame: CGRect.zero) + + translatesAutoresizingMaskIntoConstraints = false + + self.coordinator = coordinator + coordinator.viewTextFields = self + + backgroundColor = LSCreditCardFormConfig.TextFields.backgroundColor ?? UIColor.white + + scrollView = NoAutoScrollView() + scrollView.translatesAutoresizingMaskIntoConstraints = false + scrollView.backgroundColor = UIColor.clear + addSubview(scrollView) + + addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[scrollView]|", options: [], metrics: nil, views: ["scrollView": scrollView])) + addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|[scrollView]|", options: [], metrics: nil, views: ["scrollView": scrollView])) + + let contentView = UIView() + contentView.translatesAutoresizingMaskIntoConstraints = false + contentView.backgroundColor = UIColor.clear + scrollView.addSubview(contentView) + + scrollView.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[view]|", options: [], metrics: nil, views: ["view": contentView])) + scrollView.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|[view]|", options: [], metrics: nil, views: ["view": contentView])) + scrollView.addConstraint(NSLayoutConstraint(item: scrollView, attribute: .height, relatedBy: .equal, toItem: contentView, attribute: .height, multiplier: 1, constant: 0)) + + tfNumber = UITextField() + tfNumber.keyboardType = .numberPad + setup(textField: tfNumber) + contentView.addSubview(tfNumber) + + tfExpiration = UITextField() + tfExpiration.keyboardType = .numberPad + setup(textField: tfExpiration) + contentView.addSubview(tfExpiration) + + tfCVV = UITextField() + tfCVV.keyboardType = .numberPad + setup(textField: tfCVV) + contentView.addSubview(tfCVV) + + tfCardHolderName = UITextField() + tfCardHolderName.autocorrectionType = .no + tfCardHolderName.autocapitalizationType = .words + setup(textField: tfCardHolderName) + contentView.addSubview(tfCardHolderName) + + lblNumber = UILabel() + setup(textFieldLabel: lblNumber) + lblNumber.text = "CARD NUMBER" + contentView.addSubview(lblNumber) + + lblExpiration = UILabel() + setup(textFieldLabel: lblExpiration) + lblExpiration.text = "EXPIRY DATE" + contentView.addSubview(lblExpiration) + + lblCardHolderName = UILabel() + setup(textFieldLabel: lblCardHolderName) + lblCardHolderName.text = "CARD HOLDER'S NAME" + contentView.addSubview(lblCardHolderName) + + lblCVV = UILabel() + setup(textFieldLabel: lblCVV) + lblCVV.text = "CVV/CVC" + contentView.addSubview(lblCVV) + + let views: [String: Any] = ["number": tfNumber, + "expiration": tfExpiration, + "cvv": tfCVV, + "name": tfCardHolderName, + "lblNumber": lblNumber, + "lblExpiration": lblExpiration, + "lblName": lblCardHolderName, + "lblCVV": lblCVV] + + contentView.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|-20-[number(220)]-20-[expiration(100)]-20-[cvv(80)]-20-[name(250)]-20-|", options: [], metrics: nil, views: views)) + contentView.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|-6-[lblNumber]-4-[number]-10-|", options: [], metrics: nil, views: views)) + contentView.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|-6-[lblExpiration]-4-[expiration]-10-|", options: [], metrics: nil, views: views)) + contentView.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|-6-[lblName]-4-[name]-10-|", options: [], metrics: nil, views: views)) + contentView.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|-6-[lblCVV]-4-[cvv]-10-|", options: [], metrics: nil, views: views)) + contentView.addConstraint(NSLayoutConstraint(item: lblNumber, attribute: .leading, relatedBy: .equal, toItem: tfNumber, attribute: .leading, multiplier: 1, constant: 0)) + contentView.addConstraint(NSLayoutConstraint(item: lblExpiration, attribute: .leading, relatedBy: .equal, toItem: tfExpiration, attribute: .leading, multiplier: 1, constant: 0)) + contentView.addConstraint(NSLayoutConstraint(item: lblCardHolderName, attribute: .leading, relatedBy: .equal, toItem: tfCardHolderName, attribute: .leading, multiplier: 1, constant: 0)) + contentView.addConstraint(NSLayoutConstraint(item: lblCVV, attribute: .leading, relatedBy: .equal, toItem: tfCVV, attribute: .leading, multiplier: 1, constant: 0)) + + } + + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + } + + private func setup(textField: UITextField) { + textField.translatesAutoresizingMaskIntoConstraints = false + textField.font = LSCreditCardFormConfig.TextFields.font ?? UIFont.systemFont(ofSize: 16) + textField.textColor = LSCreditCardFormConfig.TextFields.textColor ?? UIColor.black + textField.delegate = self + textField.backgroundColor = UIColor.clear + + textField.addTarget(self, action: #selector(textFieldDidChange(_:)), for: .editingChanged) + } + + private func setup(textFieldLabel label: UILabel) { + label.translatesAutoresizingMaskIntoConstraints = false + label.textColor = LSCreditCardFormConfig.TextFieldLabels.textColorInactive ?? UIColor.gray + label.font = LSCreditCardFormConfig.TextFieldLabels.font ?? UIFont.systemFont(ofSize: 12) + label.setContentHuggingPriority(UILayoutPriority(rawValue: 800), for: .vertical) + } + + func focusChanged(to field: CCTextField) { + + changingResponderFromCode = true + + let newContentOffset: CGFloat + + let colorInactive = LSCreditCardFormConfig.TextFieldLabels.textColorInactive ?? UIColor.gray + let colorActive = LSCreditCardFormConfig.TextFieldLabels.textColorActive ?? UIColor.black + + lblNumber.textColor = colorInactive + lblExpiration.textColor = colorInactive + lblCVV.textColor = colorInactive + lblCardHolderName.textColor = colorInactive + + switch field { + case .number: + tfNumber.becomeFirstResponder() + lblNumber.textColor = colorActive + newContentOffset = 0 + case .expiration: + tfExpiration.becomeFirstResponder() + lblExpiration.textColor = colorActive + newContentOffset = 240 + case .cvv: + tfCVV.becomeFirstResponder() + lblCVV.textColor = colorActive + newContentOffset = 240 + case .name: + tfCardHolderName.becomeFirstResponder() + lblCardHolderName.textColor = colorActive + newContentOffset = scrollView.contentSize.width - scrollView.bounds.size.width + } + + scrollView.setContentOffset(CGPoint(x: newContentOffset, y: 0), animated: true) + + changingResponderFromCode = false + } +} + +extension LSTextFieldsView: UITextFieldDelegate { + + @objc func textFieldDidChange(_ sender: UITextField) { + + if sender == tfNumber { + + // In order to make the cursor end up positioned correctly, we need to + // explicitly reposition it after we inject spaces into the text. + // targetCursorPosition keeps track of where the cursor needs to end up as + // we modify the string, and at the end we set the cursor position to it. + let targetCursorPosition = sender.offset(from: sender.beginningOfDocument, to: sender.selectedTextRange!.start) + let (numberWithoutSpaces, newCursorPosition) = removeNonDigits(from: sender.text!, preserveCursorAt: targetCursorPosition) + + if numberWithoutSpaces.count > coordinator.creditCard.cardType.maxDigits { + sender.text = previousNumberTextFieldContent + sender.selectedTextRange = previousNumberSelection + return + } + + if let formatter = coordinator.creditCard.cardType.getFormatter { + let (cardNumberWithSpaces, finalCursorPosition) = formatter(numberWithoutSpaces, newCursorPosition) + sender.text = cardNumberWithSpaces + + if let targetPosition = sender.position(from: sender.beginningOfDocument, offset: finalCursorPosition) { + sender.selectedTextRange = sender.textRange(from: targetPosition, to: targetPosition) + } + } + + coordinator.updateCCNumber(sender.text!) + + if numberWithoutSpaces.count == coordinator.creditCard.cardType.usualDigitsCount || + numberWithoutSpaces.count == coordinator.creditCard.cardType.maxDigits { + + coordinator.changeActiveTextField(field: .expiration) + } + } + if sender == tfExpiration { + + // In order to make the cursor end up positioned correctly, we need to + // explicitly reposition it after we inject slash into the text. + // targetCursorPosition keeps track of where the cursor needs to end up as + // we modify the string, and at the end we set the cursor position to it. + let targetCursorPosition = sender.offset(from: sender.beginningOfDocument, to: sender.selectedTextRange!.start) + let (dateWithoutSlashes, newCursorPosition) = removeNonDigits(from: sender.text!, preserveCursorAt: targetCursorPosition) + + if dateWithoutSlashes.count > 4 { + sender.text = previousExpirationTextFieldContent + sender.selectedTextRange = previousExpirationSelection + return + } + + let (dateWithSlashes, finalCursorPosition) = formatExpirationDate(text: dateWithoutSlashes, cursorPosition: newCursorPosition) + sender.text = dateWithSlashes + + if let targetPosition = sender.position(from: sender.beginningOfDocument, offset: finalCursorPosition) { + sender.selectedTextRange = sender.textRange(from: targetPosition, to: targetPosition) + } + + coordinator.updateCCExpiration(sender.text!) + + if dateWithoutSlashes.count == 4 { + coordinator.changeActiveTextField(field: .cvv) + } + + } + if sender == tfCVV { + coordinator.updateCCCVV(sender.text!) + + if sender.text!.count == 3 { + coordinator.changeActiveTextField(field: .name) + } + } + if sender == tfCardHolderName { + coordinator.updateCCName(sender.text!) + } + } + + func textFieldDidBeginEditing(_ textField: UITextField) { + if changingResponderFromCode { + return + } + + if textField == tfNumber { + coordinator.changeActiveTextField(field: .number) + } else if textField == tfExpiration { + coordinator.changeActiveTextField(field: .expiration) + } else if textField == tfCVV { + coordinator.changeActiveTextField(field: .cvv) + } else { + coordinator.changeActiveTextField(field: .name) + } + } + + func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { + + if textField == tfNumber { + previousNumberTextFieldContent = textField.text! + previousNumberSelection = textField.selectedTextRange + return true + } + + if textField == tfExpiration { + previousExpirationTextFieldContent = textField.text! + previousExpirationSelection = textField.selectedTextRange + return true + } + + //check if the field has exceeded its maximum length + + //this validation is required to avoid a crash in the case of undo + let currentCharacterCount = textField.text?.count ?? 0 + if (range.length + range.location > currentCharacterCount) { + return false + } + + let newLength = currentCharacterCount + string.count - range.length + + if textField == tfCVV { + return newLength <= 3 + } else if textField == tfCardHolderName { + // always return true if deleting + if string.count == 0 { + return true + } + // only allow insertion of allowed characters (ascii chars from range 0x20...0x5f) + let asciiSet = Array(0x20...0x5f).map { return String(Character(UnicodeScalar($0))) }.joined() + let set = CharacterSet(charactersIn: asciiSet) + if string.uppercased().rangeOfCharacter(from: set) != nil { + return newLength <= 21 + } else { + return false + } + } else { + return false + } + } + + // Formatter helper methods + private func removeNonDigits(from cardNumber: String, preserveCursorAt cursorPosition: Int) -> (String, Int) { + var resultNumber = "" + var newCursorPosition = cursorPosition + + for i in 0.. (String, Int) { + var numberWithSlashes = "" + var newCursorPosition = cursorPosition + + for i in 0..