Skip to content

2.0.0

Compare
Choose a tag to compare
@kiftio kiftio released this 18 Mar 15:46
· 92 commits to main since this release
1895d9a

New Features

  1. The loading spinner has been replaced by a progress bar on the webview. This will result in a faster perceived load time for checkout because the SDK will no longer wait for full page load to show the DOM content. #129
  2. Localization has been added for the sheet title. Customize this value by modifying a shopify_checkout_sheet_title string in your Localizable.xcstrings file. #138
{
  "sourceLanguage" : "en",
  "strings" : {
    "shopify_checkout_sheet_title" : {
      "comment" : "The title of the checkout sheet.",
      "extractionState" : "manual",
      "localizations" : {
        "en" : {
          "stringUnit" : {
            "state" : "translated",
            "value" : "Checkout"
          }
        },
      }
    }
  }
}

Breaking Changes

  1. The checkoutDidComplete delegate method now returns a completed event object, containing details about the order: #128
checkoutDidComplete(event: ShopifyCheckoutSheetKit.CheckoutCompletedEvent) {
  print(event.orderDetails.id)
}
  1. spinnerColor has been replaced by tintColor:
- ShopifyCheckoutSheetKit.configuration.spinnerColor = .systemBlue
+ ShopifyCheckoutSheetKit.configuration.tintColor = .systemBlue

Deprecations

  1. CheckoutViewController.Representable() for SwiftUI has been deprecated. Please use CheckoutSheet(checkout:) now instead.
.sheet(isPresented: $isShowingCheckout, onDismiss: didDismiss) {
-  CheckoutViewController.Representable(checkout: $checkoutURL, delegate: eventHandler)
-    .onReceive(eventHandler.$didCancel, perform: { didCancel in
-      if didCancel {
-        isShowingCheckout = false
-      }
-    })
+  CheckoutSheet(checkout: $checkoutURL)
+    .title("Custom title")
+    .colorScheme(.automatic)
+    .backgroundColor(.black)
+    .tintColor(.systemBlue)
+    .onCancel {
+       isShowingCheckout = false
+    }
+    .onComplete { }
+    .onPixelEvent { }
+    .onFail { }
+    .onLinkClick { }
}