Skip to content

Commit 9c36011

Browse files
fix: add workaround to ensure delegate isn't deallocated when parent changes (#296)
* fix: add workaround to ensure delegate isn't deallocated when parent changes * 🚀 v3.1.3 * fix: formatting of tabs vs spaces * chore: add logging incase we cannot find the viewcontroller * fix: date on changelog * fix: add names of checkout web view controller models to log * fix: move from patch to minor version bump
1 parent 9f12ee0 commit 9c36011

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 3.2.0 - 20 June, 2025
4+
5+
- Ensure `self.delegate` is set for `CheckoutViewController` after state changes
6+
7+
https://github.com/Shopify/checkout-sheet-kit-swift/pull/296
8+
39
## 3.1.2 - November 6, 2024
410

511
- Remove redundant code

ShopifyCheckoutSheetKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Pod::Spec.new do |s|
2-
s.version = "3.1.2"
2+
s.version = "3.2.0"
33

44
s.name = "ShopifyCheckoutSheetKit"
55
s.summary = "Enables Swift apps to embed the Shopify's highest converting, customizable, one-page checkout."

Sources/ShopifyCheckoutSheetKit/CheckoutViewController.swift

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,21 @@ public struct CheckoutSheet: UIViewControllerRepresentable, CheckoutConfigurable
7878
return CheckoutViewController(checkout: checkoutURL, delegate: delegate)
7979
}
8080

81-
public func updateUIViewController(_ uiViewController: CheckoutViewController, context: Self.Context) {}
81+
public func updateUIViewController(_ uiViewController: CheckoutViewController, context: Self.Context) {
82+
guard
83+
let webViewController = uiViewController
84+
.viewControllers
85+
.compactMap({ $0 as? CheckoutWebViewController })
86+
.first
87+
else {
88+
return
89+
}
90+
OSLogger.shared.debug(
91+
"[CheckoutViewController#updateUIViewController]: No ViewControllers matching CheckoutWebViewController \(uiViewController.viewControllers.map {String(describing: $0.self)}.joined(separator: ""))"
92+
)
93+
94+
webViewController.delegate = delegate
95+
}
8296

8397
/// Lifecycle methods
8498

Sources/ShopifyCheckoutSheetKit/ShopifyCheckoutSheetKit.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SO
2424
import UIKit
2525

2626
/// The version of the `ShopifyCheckoutSheetKit` library.
27-
public let version = "3.1.2"
27+
public let version = "3.2.0"
2828

2929
internal var invalidateOnConfigurationChange = true
3030

0 commit comments

Comments
 (0)