From 57ee060d9c94c89fddf01b3d3dcf9cfbd96cc7a6 Mon Sep 17 00:00:00 2001 From: Mark Murray Date: Tue, 5 Mar 2024 15:37:19 +0000 Subject: [PATCH] Annotate with @discardableResult --- Samples/SwiftUIExample/SwiftUIExample/CatalogView.swift | 6 +++--- .../ShopifyCheckoutSheetKit/ShopifyCheckoutSheetKit.swift | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Samples/SwiftUIExample/SwiftUIExample/CatalogView.swift b/Samples/SwiftUIExample/SwiftUIExample/CatalogView.swift index f7790162..4c3ba348 100644 --- a/Samples/SwiftUIExample/SwiftUIExample/CatalogView.swift +++ b/Samples/SwiftUIExample/SwiftUIExample/CatalogView.swift @@ -148,9 +148,9 @@ struct CatalogView: View { } ToolbarItemGroup { BadgeButton(badgeCount: Int(cartManager.cart?.totalQuantity ?? 0), action: { - isShowingCart = true - }) - .accessibilityIdentifier("cartIcon") + isShowingCart = true + }) + .accessibilityIdentifier("cartIcon") Button(action: { onAppear() diff --git a/Sources/ShopifyCheckoutSheetKit/ShopifyCheckoutSheetKit.swift b/Sources/ShopifyCheckoutSheetKit/ShopifyCheckoutSheetKit.swift index 5e155a6d..4438387d 100644 --- a/Sources/ShopifyCheckoutSheetKit/ShopifyCheckoutSheetKit.swift +++ b/Sources/ShopifyCheckoutSheetKit/ShopifyCheckoutSheetKit.swift @@ -53,6 +53,7 @@ public func preload(checkout url: URL) { } /// Presents the checkout from a given `UIViewController`. +@discardableResult public func present(checkout url: URL, from: UIViewController, delegate: CheckoutDelegate? = nil) -> CheckoutViewController { let viewController = CheckoutViewController(checkout: url, delegate: delegate) from.present(viewController, animated: true)