-
Notifications
You must be signed in to change notification settings - Fork 975
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 update pt 2 - update view #4150
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few non blocking Q's, nice!
embeddedPaymentMethodsView: embeddedPaymentMethodsView | ||
) | ||
|
||
self.containerView.updateSuperviewHeight = { [weak self] in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to not just remove containerView
and just return it directly on view
? Guessing it's to avoid casting between UIView and the container view?
/// The view that's vended to the merchant, containing the embedded view. We use this to be able to swap out the embedded view with an animation when `update` is called. | ||
class EmbeddedPaymentElementContainerView: UIView { | ||
var updateSuperviewHeight: () -> Void = {} | ||
var view: UIView |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason these aren't private (excluding updateSuperviewHeight
, although that feels like it should come in at init time and be optional)? Also wondering it it ever makes sense to use this class when view
is not of type EmbeddedPaymentMethodsView
. Should it just be EmbeddedPaymentMethodsView
over UIView
in this class?
@_spi(STP) @testable import StripeUICore | ||
import XCTest | ||
|
||
class EmbeddedPaymentElementSnapshotTests: STPSnapshotTestCase, EmbeddedPaymentElementDelegate { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we planning to add more tests to this file? If so do we have a ticket or will that happen as a follow up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is all the transparent padding expected? Would that be the merchant's UI/background in the real world?
Summary
Previous PR: #4141
Makes EmbeddedPaymentElement view a view that contains embedded view so we can swap to the updated embedded view with an animation.
Simulator.Screen.Recording.-.snapshot.tester.iPhone.12.mini.16.4.-.2024-10-16.at.11.40.47.mp4
Still to come:
Motivation
https://jira.corp.stripe.com/browse/MOBILESDK-2583
Testing
See snapshot test.
Changelog
Not user facing