Skip to content

Commit

Permalink
Update project struct for SPM (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneIOs authored May 6, 2021
1 parent 18671e1 commit 2a76479
Show file tree
Hide file tree
Showing 33 changed files with 1,494 additions and 18 deletions.
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>CardIO.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>CardIOSDK.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>CardIO</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>CardIOSDK</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
48 changes: 30 additions & 18 deletions CardIOSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 52;
objects = {

/* Begin PBXBuildFile section */
32886C3923ED7FDC001CCF33 /* CardIOSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32886C2F23ED7FDC001CCF33 /* CardIOSDK.framework */; };
32886C3E23ED7FDC001CCF33 /* CardIOSDKTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 32886C3D23ED7FDC001CCF33 /* CardIOSDKTests.m */; };
32886C4023ED7FDC001CCF33 /* CardIOSDK.h in Headers */ = {isa = PBXBuildFile; fileRef = 32886C3223ED7FDC001CCF33 /* CardIOSDK.h */; settings = {ATTRIBUTES = (Public, ); }; };
446DA62F2643F55600DDBD5E /* CardIO.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 446DA62C2643F55600DDBD5E /* CardIO.xcframework */; };
446DA6302643F55600DDBD5E /* CardIOSDK.h in Headers */ = {isa = PBXBuildFile; fileRef = 446DA62D2643F55600DDBD5E /* CardIOSDK.h */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -24,18 +25,20 @@

/* Begin PBXFileReference section */
32886C2F23ED7FDC001CCF33 /* CardIOSDK.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CardIOSDK.framework; sourceTree = BUILT_PRODUCTS_DIR; };
32886C3223ED7FDC001CCF33 /* CardIOSDK.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CardIOSDK.h; sourceTree = "<group>"; };
32886C3323ED7FDC001CCF33 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
32886C3823ED7FDC001CCF33 /* CardIOSDKTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CardIOSDKTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
32886C3D23ED7FDC001CCF33 /* CardIOSDKTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CardIOSDKTests.m; sourceTree = "<group>"; };
32886C3F23ED7FDC001CCF33 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
446DA62C2643F55600DDBD5E /* CardIO.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = CardIO.xcframework; sourceTree = "<group>"; };
446DA62D2643F55600DDBD5E /* CardIOSDK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOSDK.h; sourceTree = "<group>"; };
446DA62E2643F55600DDBD5E /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
32886C2C23ED7FDC001CCF33 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
446DA62F2643F55600DDBD5E /* CardIO.xcframework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -53,7 +56,7 @@
32886C2523ED7FDC001CCF33 = {
isa = PBXGroup;
children = (
32886C3123ED7FDC001CCF33 /* CardIOSDK */,
446DA62A2643F55600DDBD5E /* Sources */,
32886C3C23ED7FDC001CCF33 /* CardIOSDKTests */,
32886C3023ED7FDC001CCF33 /* Products */,
);
Expand All @@ -68,22 +71,31 @@
name = Products;
sourceTree = "<group>";
};
32886C3123ED7FDC001CCF33 /* CardIOSDK */ = {
32886C3C23ED7FDC001CCF33 /* CardIOSDKTests */ = {
isa = PBXGroup;
children = (
32886C3223ED7FDC001CCF33 /* CardIOSDK.h */,
32886C3323ED7FDC001CCF33 /* Info.plist */,
32886C3D23ED7FDC001CCF33 /* CardIOSDKTests.m */,
32886C3F23ED7FDC001CCF33 /* Info.plist */,
);
path = CardIOSDK;
path = CardIOSDKTests;
sourceTree = "<group>";
};
32886C3C23ED7FDC001CCF33 /* CardIOSDKTests */ = {
446DA62A2643F55600DDBD5E /* Sources */ = {
isa = PBXGroup;
children = (
32886C3D23ED7FDC001CCF33 /* CardIOSDKTests.m */,
32886C3F23ED7FDC001CCF33 /* Info.plist */,
446DA62B2643F55600DDBD5E /* CardIOSDK */,
);
path = CardIOSDKTests;
path = Sources;
sourceTree = "<group>";
};
446DA62B2643F55600DDBD5E /* CardIOSDK */ = {
isa = PBXGroup;
children = (
446DA62C2643F55600DDBD5E /* CardIO.xcframework */,
446DA62D2643F55600DDBD5E /* CardIOSDK.h */,
446DA62E2643F55600DDBD5E /* Info.plist */,
);
path = CardIOSDK;
sourceTree = "<group>";
};
/* End PBXGroup section */
Expand All @@ -93,7 +105,7 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
32886C4023ED7FDC001CCF33 /* CardIOSDK.h in Headers */,
446DA6302643F55600DDBD5E /* CardIOSDK.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -343,15 +355,15 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = CardIOSDK/Info.plist;
INFOPLIST_FILE = "$(SRCROOT)/Sources/CardIOSDK/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 5.5.4;
MARKETING_VERSION = 5.5.5;
PRODUCT_BUNDLE_IDENTIFIER = com.dkh.io.CardIOSDK;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand All @@ -369,15 +381,15 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = CardIOSDK/Info.plist;
INFOPLIST_FILE = "$(SRCROOT)/Sources/CardIOSDK/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 5.5.4;
MARKETING_VERSION = 5.5.5;
PRODUCT_BUNDLE_IDENTIFIER = com.dkh.io.CardIOSDK;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>CardIOSDK.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
20 changes: 20 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "CardIOSDK",
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "CardIOSDK",
targets: ["CardIO"]),
],
dependencies: [

],
targets: [
.binaryTarget(name: "CardIO", path: "./Sources/CardIOSDK/CardIO.xcframework")
]
)
42 changes: 42 additions & 0 deletions Sources/CardIOSDK/CardIO.xcframework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_armv7</string>
<key>LibraryPath</key>
<string>CardIO.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>armv7</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_i386_x86_64-simulator</string>
<key>LibraryPath</key>
<string>CardIO.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>i386</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// CardIO.h
// See the file "LICENSE.md" for the full license governing this code.
//

// All-in-one header file for card.io sdk.
#import "CardIOCreditCardInfo.h"
#import "CardIODetectionMode.h"
#import "CardIOView.h"
#import "CardIOViewDelegate.h"
#import "CardIOPaymentViewController.h"
#import "CardIOPaymentViewControllerDelegate.h"
#import "CardIOUtilities.h"

Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
//
// CardIOCreditCardInfo.h
// See the file "LICENSE.md" for the full license governing this code.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

/// CardIOCreditCardType Identifies type of card.
typedef NS_ENUM(NSInteger, CardIOCreditCardType) {
/// The card number does not correspond to any recognizable card type.
CardIOCreditCardTypeUnrecognized = 0,
/// The card number corresponds to multiple card types (e.g., when only a few digits have been entered).
CardIOCreditCardTypeAmbiguous = 1,
/// American Express
CardIOCreditCardTypeAmex = '3',
/// Japan Credit Bureau
CardIOCreditCardTypeJCB = 'J',
/// VISA
CardIOCreditCardTypeVisa = '4',
/// MasterCard
CardIOCreditCardTypeMastercard = '5',
/// Discover Card
CardIOCreditCardTypeDiscover = '6'
};


/// Container for the information about a card.
@interface CardIOCreditCardInfo : NSObject<NSCopying>

/// Card number.
@property(nonatomic, copy, readwrite) NSString *cardNumber;

/// Card number with all but the last four digits obfuscated.
@property(nonatomic, copy, readonly) NSString *redactedCardNumber;

/// January == 1
/// @note expiryMonth & expiryYear may be 0, if expiry information was not requested.
@property(nonatomic, assign, readwrite) NSUInteger expiryMonth;

/// The full four digit year.
/// @note expiryMonth & expiryYear may be 0, if expiry information was not requested.
@property(nonatomic, assign, readwrite) NSUInteger expiryYear;

/// Security code (aka CSC, CVV, CVV2, etc.)
/// @note May be nil, if security code was not requested.
@property(nonatomic, copy, readwrite) NSString *cvv;

/// Postal code. Format is country dependent.
/// @note May be nil, if postal code information was not requested.
@property(nonatomic, copy, readwrite) NSString *postalCode;

/// Cardholder Name.
/// @note May be nil, if cardholder name was not requested.
@property(nonatomic, copy, readwrite) NSString *cardholderName;

/// Was the card number scanned (as opposed to entered manually)?
@property(nonatomic, assign, readwrite) BOOL scanned;

/// The rectified card image; usually 428x270.
@property(nonatomic, strong, readwrite) UIImage *cardImage;

/// Derived from cardNumber.
/// @note CardIOCreditInfo objects returned by either of the delegate methods
/// userDidProvideCreditCardInfo:inPaymentViewController:
/// or cardIOView:didScanCard:
/// will never return a cardType of CardIOCreditCardTypeAmbiguous.
@property(nonatomic, assign, readonly) CardIOCreditCardType cardType;

/// Convenience method which returns a card type string suitable for display (e.g. "Visa", "American Express", "JCB", "MasterCard", or "Discover").
/// Where appropriate, this string will be translated into the language specified.
/// @param cardType The card type.
/// @param languageOrLocale See CardIOPaymentViewController.h for a detailed explanation of languageOrLocale.
/// @return Card type string suitable for display.
+ (NSString *)displayStringForCardType:(CardIOCreditCardType)cardType usingLanguageOrLocale:(NSString *)languageOrLocale;

/// Returns a 36x25 credit card logo, at a resolution appropriate for the device.
/// @param cardType The card type.
/// @return 36x25 credit card logo.
+ (UIImage *)logoForCardType:(CardIOCreditCardType)cardType;

@end

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// CardIODetectionMode.h
// See the file "LICENSE.md" for the full license governing this code.
//
//

#ifndef icc_CardIODetectionMode_h
#define icc_CardIODetectionMode_h

typedef NS_ENUM(NSInteger, CardIODetectionMode) {
CardIODetectionModeCardImageAndNumber = 0,
CardIODetectionModeCardImageOnly,
CardIODetectionModeAutomatic
};

#endif

Loading

0 comments on commit 2a76479

Please sign in to comment.