Skip to content

Commit

Permalink
Fix landscape and SE bug
Browse files Browse the repository at this point in the history
  • Loading branch information
justinswart committed May 11, 2020
1 parent 8e98266 commit 761dcb2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ final class PledgeAmountViewController: UIViewController {
}
}

override func didMove(toParent parent: UIViewController?) {
override func didMove(toParent _: UIViewController?) {
self.verticalSpacer.isHidden = true
}

Expand Down
11 changes: 9 additions & 2 deletions Kickstarter-iOS/Views/Controllers/PledgeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,14 @@ final class PledgeViewController: UIViewController,
self.sessionStartedObserver.doIfSome(NotificationCenter.default.removeObserver)
}

override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)

// Works around a layout bug when in landscape or on iPhone SE - last observed on iOS 13.4.
self.addChild(self.paymentMethodsViewController)
self.paymentMethodsViewController.didMove(toParent: self)
}

// MARK: - Configuration

private func configureChildViewControllers() {
Expand All @@ -189,8 +197,7 @@ final class PledgeViewController: UIViewController,
self.pledgeAmountViewController,
self.pledgeAmountSummaryViewController,
self.shippingLocationViewController,
self.summaryViewController,
self.paymentMethodsViewController
self.summaryViewController
]

let arrangedSubviews = [
Expand Down

0 comments on commit 761dcb2

Please sign in to comment.