Making loading height configurable via init (#2567)

This commit is contained in:
John Woo 2023-05-15 15:09:56 -07:00 committed by GitHub
parent 78b4332e5f
commit ff6390e37f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -247,7 +247,8 @@ public class PaymentSheet {
let loadingViewController = LoadingViewController(
delegate: self,
appearance: configuration.appearance,
isTestMode: isTestMode
isTestMode: isTestMode,
loadingViewHeight: 244
)
let vc = BottomSheetViewController(

View File

@ -42,7 +42,8 @@ internal enum SavedPaymentMethodsSheetResult {
let loadingViewController = LoadingViewController(
delegate: self,
appearance: configuration.appearance,
isTestMode: isTestMode
isTestMode: isTestMode,
loadingViewHeight: 180
)
let vc = BottomSheetViewController(

View File

@ -35,15 +35,16 @@ class LoadingViewController: UIViewController, BottomSheetContentViewController
func didTapOrSwipeToDismiss() {
delegate?.shouldDismiss(self)
}
let loadingViewHeight: CGFloat = 244
let loadingViewHeight: CGFloat
var panScrollable: UIScrollView?
let activityIndicator = UIActivityIndicatorView(style: .medium)
weak var delegate: LoadingViewControllerDelegate?
init(delegate: LoadingViewControllerDelegate, appearance: PaymentSheet.Appearance, isTestMode: Bool) {
init(delegate: LoadingViewControllerDelegate, appearance: PaymentSheet.Appearance, isTestMode: Bool, loadingViewHeight: CGFloat) {
self.delegate = delegate
self.appearance = appearance
self.isTestMode = isTestMode
self.loadingViewHeight = loadingViewHeight
super.init(nibName: nil, bundle: nil)
}