Skip to content

Commit

Permalink
Rewrite everything
Browse files Browse the repository at this point in the history
  • Loading branch information
markmur committed Nov 21, 2024
1 parent 2a403dd commit 8729f84
Show file tree
Hide file tree
Showing 18 changed files with 940 additions and 569 deletions.
2 changes: 2 additions & 0 deletions Samples/MobileBuyIntegration/.swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
disabled_rules:
- line_length
- todo
- multiple_closures_with_trailing_closure

opt_in_rules:
- array_init
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@
4EA7F9B62A9D2B9D003276A1 /* SettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EA7F9B42A9D2B9D003276A1 /* SettingsViewController.swift */; };
4EBBA76B2A5F0CE200193E19 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EBBA76A2A5F0CE200193E19 /* AppDelegate.swift */; };
4EBBA76D2A5F0CE200193E19 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EBBA76C2A5F0CE200193E19 /* SceneDelegate.swift */; };
4EBBA76F2A5F0CE200193E19 /* ProductViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EBBA76E2A5F0CE200193E19 /* ProductViewController.swift */; };
4EBBA76F2A5F0CE200193E19 /* ProductView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EBBA76E2A5F0CE200193E19 /* ProductView.swift */; };
4EBBA7742A5F0CE200193E19 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4EBBA7732A5F0CE200193E19 /* Assets.xcassets */; };
4EBBA7772A5F0CE200193E19 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4EBBA7752A5F0CE200193E19 /* LaunchScreen.storyboard */; };
4EBBA7A32A5F0F5600193E19 /* Buy in Frameworks */ = {isa = PBXBuildFile; productRef = 4EBBA7A22A5F0F5600193E19 /* Buy */; };
4EBBA7AA2A5F124F00193E19 /* StorefrontClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EBBA7A92A5F124F00193E19 /* StorefrontClient.swift */; };
4EBBA7AC2A5F18B900193E19 /* ProductViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4EBBA7AB2A5F18B900193E19 /* ProductViewController.xib */; };
4EBBA7AE2A5F1BBF00193E19 /* UIImageView+URL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EBBA7AD2A5F1BBF00193E19 /* UIImageView+URL.swift */; };
4EBBA7B02A5F222F00193E19 /* MoneyV2+Format.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EBBA7AF2A5F222F00193E19 /* MoneyV2+Format.swift */; };
4EF54F242A6F456B00F5E407 /* CartManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EF54F232A6F456B00F5E407 /* CartManager.swift */; };
4EF54F272A6F4C4F00F5E407 /* CartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EF54F262A6F4C4F00F5E407 /* CartViewController.swift */; };
4EF54F312A6F63C000F5E407 /* CartViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4EF54F2F2A6F63C000F5E407 /* CartViewController.xib */; };
6A0FA77E2CE4D7F7003070F8 /* MobileBuyIntegration.entitlements in Resources */ = {isa = PBXBuildFile; fileRef = 6AE865492CE3BB6500A4971C /* MobileBuyIntegration.entitlements */; };
6A257A132AFBA78500610DA5 /* LogReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A257A122AFBA78500610DA5 /* LogReader.swift */; };
6A257A152AFBB06300610DA5 /* Logger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A257A142AFBB06300610DA5 /* Logger.swift */; };
6A2E77BE2CE606490067062D /* Catalog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A2E77BD2CE606400067062D /* Catalog.swift */; };
6A2E77C02CE618720067062D /* Cart.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A2E77BF2CE6186F0067062D /* Cart.swift */; };
6A34672F2B5FFEFB007314A8 /* WebPixelEventsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A34672E2B5FFEFB007314A8 /* WebPixelEventsView.swift */; };
6A3467332B600E64007314A8 /* LogsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A3467322B600E64007314A8 /* LogsView.swift */; };
6A3D7ADC2B8E01460010EB27 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 6A3D7ADB2B8E01460010EB27 /* Localizable.xcstrings */; };
Expand All @@ -38,20 +39,20 @@
4EBBA7672A5F0CE200193E19 /* MobileBuyIntegration.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MobileBuyIntegration.app; sourceTree = BUILT_PRODUCTS_DIR; };
4EBBA76A2A5F0CE200193E19 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
4EBBA76C2A5F0CE200193E19 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
4EBBA76E2A5F0CE200193E19 /* ProductViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductViewController.swift; sourceTree = "<group>"; };
4EBBA76E2A5F0CE200193E19 /* ProductView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductView.swift; sourceTree = "<group>"; };
4EBBA7732A5F0CE200193E19 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
4EBBA7762A5F0CE200193E19 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
4EBBA7782A5F0CE200193E19 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4EBBA7A72A5F10C400193E19 /* Storefront.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Storefront.xcconfig; sourceTree = SOURCE_ROOT; };
4EBBA7A92A5F124F00193E19 /* StorefrontClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StorefrontClient.swift; sourceTree = "<group>"; };
4EBBA7AB2A5F18B900193E19 /* ProductViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ProductViewController.xib; sourceTree = "<group>"; };
4EBBA7AD2A5F1BBF00193E19 /* UIImageView+URL.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImageView+URL.swift"; sourceTree = "<group>"; };
4EBBA7AF2A5F222F00193E19 /* MoneyV2+Format.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MoneyV2+Format.swift"; sourceTree = "<group>"; };
4EF54F232A6F456B00F5E407 /* CartManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CartManager.swift; sourceTree = "<group>"; };
4EF54F262A6F4C4F00F5E407 /* CartViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CartViewController.swift; sourceTree = "<group>"; };
4EF54F2F2A6F63C000F5E407 /* CartViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CartViewController.xib; sourceTree = "<group>"; };
6A257A122AFBA78500610DA5 /* LogReader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogReader.swift; sourceTree = "<group>"; };
6A257A142AFBB06300610DA5 /* Logger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Logger.swift; sourceTree = "<group>"; };
6A2E77BD2CE606400067062D /* Catalog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Catalog.swift; sourceTree = "<group>"; };
6A2E77BF2CE6186F0067062D /* Cart.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Cart.swift; sourceTree = "<group>"; };
6A34672E2B5FFEFB007314A8 /* WebPixelEventsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebPixelEventsView.swift; sourceTree = "<group>"; };
6A3467322B600E64007314A8 /* LogsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogsView.swift; sourceTree = "<group>"; };
6A3D7ADB2B8E01460010EB27 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; };
Expand Down Expand Up @@ -116,15 +117,15 @@
4EBBA77F2A5F0DA300193E19 /* Application */ = {
isa = PBXGroup;
children = (
6A2E77BF2CE6186F0067062D /* Cart.swift */,
6A2E77BD2CE606400067062D /* Catalog.swift */,
4EBBA76A2A5F0CE200193E19 /* AppDelegate.swift */,
86250DE32AD5521C002E45C2 /* AppConfiguration.swift */,
4EBBA76C2A5F0CE200193E19 /* SceneDelegate.swift */,
4EF54F232A6F456B00F5E407 /* CartManager.swift */,
4EBBA7A92A5F124F00193E19 /* StorefrontClient.swift */,
4EBBA76E2A5F0CE200193E19 /* ProductViewController.swift */,
4EBBA7AB2A5F18B900193E19 /* ProductViewController.xib */,
4EBBA76E2A5F0CE200193E19 /* ProductView.swift */,
4EF54F262A6F4C4F00F5E407 /* CartViewController.swift */,
4EF54F2F2A6F63C000F5E407 /* CartViewController.xib */,
4EA7F9B42A9D2B9D003276A1 /* SettingsViewController.swift */,
6A257A122AFBA78500610DA5 /* LogReader.swift */,
6A257A142AFBB06300610DA5 /* Logger.swift */,
Expand Down Expand Up @@ -228,10 +229,9 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6A0FA77E2CE4D7F7003070F8 /* MobileBuyIntegration.entitlements in Resources */,
4EBBA7772A5F0CE200193E19 /* LaunchScreen.storyboard in Resources */,
4EF54F312A6F63C000F5E407 /* CartViewController.xib in Resources */,
6A3D7ADC2B8E01460010EB27 /* Localizable.xcstrings in Resources */,
4EBBA7AC2A5F18B900193E19 /* ProductViewController.xib in Resources */,
4EBBA7742A5F0CE200193E19 /* Assets.xcassets in Resources */,
2147F3E62B502AFD005546F3 /* checkout-sheet-kit-swift in Resources */,
);
Expand Down Expand Up @@ -268,14 +268,16 @@
4EBBA7AE2A5F1BBF00193E19 /* UIImageView+URL.swift in Sources */,
6A34672F2B5FFEFB007314A8 /* WebPixelEventsView.swift in Sources */,
4EBBA7B02A5F222F00193E19 /* MoneyV2+Format.swift in Sources */,
6A2E77BE2CE606490067062D /* Catalog.swift in Sources */,
4EF54F242A6F456B00F5E407 /* CartManager.swift in Sources */,
4EBBA76F2A5F0CE200193E19 /* ProductViewController.swift in Sources */,
4EBBA76F2A5F0CE200193E19 /* ProductView.swift in Sources */,
4EF54F272A6F4C4F00F5E407 /* CartViewController.swift in Sources */,
4EBBA76B2A5F0CE200193E19 /* AppDelegate.swift in Sources */,
86250DE42AD5521C002E45C2 /* AppConfiguration.swift in Sources */,
4EBBA7AA2A5F124F00193E19 /* StorefrontClient.swift in Sources */,
6A257A152AFBB06300610DA5 /* Logger.swift in Sources */,
4EBBA76D2A5F0CE200193E19 /* SceneDelegate.swift in Sources */,
6A2E77C02CE618720067062D /* Cart.swift in Sources */,
6A774DD12B58023400C8EF7E /* CountryCode+inferRegion.swift in Sources */,
4EA7F9B62A9D2B9D003276A1 /* SettingsViewController.swift in Sources */,
6A3467332B600E64007314A8 /* LogsView.swift in Sources */,
Expand Down Expand Up @@ -426,12 +428,12 @@
DEVELOPMENT_TEAM = A7XGC83MZE;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = MobileBuyIntegration/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "Checkout Sheet Kit";
INFOPLIST_KEY_CFBundleDisplayName = Plant;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -456,12 +458,12 @@
DEVELOPMENT_TEAM = A7XGC83MZE;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = MobileBuyIntegration/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "Checkout Sheet Kit";
INFOPLIST_KEY_CFBundleDisplayName = Plant;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

ShopifyCheckoutSheetKit.configure {
/// Checkout color scheme setting
$0.colorScheme = .automatic
$0.colorScheme = .web

/// Customize progress bar color
$0.tintColor = ColorPalette.primaryColor

/// Customize sheet color (matches web configuration by default)
$0.backgroundColor = ColorPalette.backgroundColor

/// Enable preloading
$0.preloading.enabled = true
Expand All @@ -43,7 +49,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

print("[MobileBuyIntegration] Log level set to .all")

UIBarButtonItem.appearance().tintColor = .label
UIBarButtonItem.appearance().tintColor = ColorPalette.primaryColor

return true
}
Expand All @@ -52,3 +58,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
return UISceneConfiguration(name: "Default", sessionRole: connectingSceneSession.role)
}
}

struct ColorPalette {
static let primaryColor = UIColor(red: 37/255, green: 96/255, blue: 79/255, alpha: 1.0)
static let successColor = UIColor(red: 31/255, green: 59/255, blue: 51/255, alpha: 1.0)
static let backgroundColor = UIColor(red: 249/255, green: 248/255, blue: 246/255, alpha: 1.0)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "plant.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8729f84

Please sign in to comment.