-
Notifications
You must be signed in to change notification settings - Fork 997
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Embedded SwiftUI example #4445
base: master
Are you sure you want to change the base?
Embedded SwiftUI example #4445
Conversation
🚨 New dead code detected in this PR: EmbeddedPaymentElement+SwiftUI.swift:205 warning: Property 'parent' is assigned, but never used Please remove the dead code before merging. If this is intentional, you can bypass this check by adding the label ℹ️ If this comment appears to be left in error, double check that the flagged code is actually used and/or make sure your branch is up-to-date with |
1 build increased size, 2 builds decreased size, 5 builds had no size change
StripeSize 1.0 (1)
|
Item | Install Size Change |
---|---|
📝 StripePaymentSheet.EmbeddedPaymentElementViewModel.EmbeddedPaymen... | ⬆️ 2.3 kB |
DYLD.Exports | ⬆️ 1.7 kB |
DYLD.Fixups | ⬆️ 1.5 kB |
DYLD.String Table | ⬆️ 1.4 kB |
StripePaymentSheet.EmbeddedFormViewController.paymentMethodFormVi... | ⬇️ -1.4 kB |
StripeIdentitySize 1.0 (1)
com.stripe.StripeIdentitySize
No changes to report
StripeApplePaySize 1.0 (1)
com.stripe.StripeApplePaySize
No changes to report
StripeFinancialConnectionsSize 1.0 (1)
com.stripe.StripeFinancialConnectionsSize
⚖️ Compare build
⏱️ Analyze build performance
Total install size change: ⬇️ 191.4 kB (-4.1%)
Total download size change: ⬇️ 66.3 kB (-4.53%)
Largest size changes
Item | Install Size Change |
---|---|
🗑 StripeFinancialConnections.FinancialConnectionsAsyncAPIClient | ⬇️ -13.5 kB |
Swift._NativeDictionary.merge(isUnique,uniquingKeysWith) | ⬇️ -4.4 kB |
Code Signature | ⬇️ -4.2 kB |
📝 StripeFinancialConnections.NativeFlowAPIDataManager.manifest.dids... | ⬆️ 2.0 kB |
StripeFinancialConnections.NativeFlowAPIDataManager.init(manifest... | ⬆️ 1.8 kB |
StripeConnectSize 1.0 (1)
com.stripe.StripeConnectSize
⚖️ Compare build
⏱️ Analyze build performance
Total install size change: ⬇️ 193.3 kB (-3.74%)
Total download size change: ⬇️ 67.6 kB (-4.16%)
Largest size changes
Item | Install Size Change |
---|---|
🗑 StripeFinancialConnections.FinancialConnectionsAsyncAPIClient | ⬇️ -13.6 kB |
Code Signature | ⬇️ -5.0 kB |
Swift._NativeDictionary.merge(isUnique,uniquingKeysWith) | ⬇️ -4.4 kB |
📝 StripeFinancialConnections.NativeFlowAPIDataManager.manifest.dids... | ⬆️ 2.0 kB |
StripeFinancialConnections.NativeFlowAPIDataManager.init(manifest... | ⬆️ 1.8 kB |
🛸 Powered by Emerge Tools
Comment trigger: Size diff threshold of 100.00kB exceeded
Summary
EmbeddedPaymentElementView
and a lightweightEmbeddedPaymentViewModel
.makeUIView
is required. Instead of directly attaching the embedded view to SwiftUI, we use a container. This container gives us a fixed point to apply layout constraints and measure the embedded view's size. If we skipped the container and used the embedded view directly, its height would be undefined, causing constraint breakages and leading SwiftUI to treat it as zero.UIViewRepresentable
and the SwiftUI: There is a workaround that would allow us to remove this, but we lose the ability to animate smoothly. Passing this binding to the SwfitUI view allows us to animate the height.Payment
Simulator.Screen.Recording.-.iOS.18.-.2025-01-08.at.10.07.20.mp4
Height animation
Simulator.Screen.Recording.-.iOS.18.-.2025-01-08.at.10.08.43.mp4
Updates
Simulator.Screen.Recording.-.iOS.18.-.2025-01-10.at.10.48.30.mp4
Motivation
Testing
Changelog
N/A