Skip to content

Commit

Permalink
Bandaid fix for missing PaymentSheet loading -> loaded animation. (#1390
Browse files Browse the repository at this point in the history
)

Long-term fix is to revert this commit, add `animated: Bool` params to SectionContainerView, AddressSection, etc., and make the `updateBillingSameAsShippingDefaultAddress` call in `AddPaymentMethodViewController.willAppear` pass `animated: false`. If it animates during viewWillAppear, the view controller presentation animation becomes glitchy.
  • Loading branch information
yuki-stripe authored Aug 25, 2022
1 parent bf2be42 commit 90977a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Stripe/BottomSheetViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class BottomSheetViewController: UIViewController, BottomSheetPresentable {
}
self.contentContainerView.layoutIfNeeded()

animateHeightChange()
animateHeightChange(forceAnimation: true)
// Add its navigation bar if necessary
oldContentViewController.navigationBar.removeFromSuperview()
navigationBarContainerView.addArrangedSubview(contentViewController.navigationBar)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import UIKit

@_spi(STP) public extension UIViewController {
/// Use this to animate changes that affect the height of the sheet
func animateHeightChange(duration: CGFloat = 0.5, _ animations: (() -> Void)? = nil, completion: ((Bool) -> Void)? = nil)
func animateHeightChange(forceAnimation: Bool = false, duration: CGFloat = 0.5, _ animations: (() -> Void)? = nil, completion: ((Bool) -> Void)? = nil)
{
guard !isBeingPresented else {
guard forceAnimation || !isBeingPresented else {
animations?()
return
}
Expand Down

0 comments on commit 90977a8

Please sign in to comment.