Skip to content

Commit

Permalink
Return view controller from present method
Browse files Browse the repository at this point in the history
  • Loading branch information
markmur committed Mar 7, 2024
1 parent a8a0fa6 commit 5031c70
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sources/ShopifyCheckoutSheetKit/ShopifyCheckoutSheetKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public func preload(checkout url: URL) {
}

/// Presents the checkout from a given `UIViewController`.
public func present(checkout url: URL, from: UIViewController, delegate: CheckoutDelegate? = nil) {
from.present(CheckoutViewController(checkout: url, delegate: delegate), animated: true)
public func present(checkout url: URL, from: UIViewController, delegate: CheckoutDelegate? = nil) -> CheckoutViewController {
let viewController = CheckoutViewController(checkout: url, delegate: delegate)
from.present(viewController, animated: true)
return viewController
}

0 comments on commit 5031c70

Please sign in to comment.