Replace user indicator presenting view controller with context

This commit is contained in:
Andy Uhnak
2022-03-08 11:01:44 +00:00
parent 7c60341121
commit 72179db80f
7 changed files with 75 additions and 40 deletions
@@ -22,18 +22,18 @@ import UIKit
/// It is managed by a `UserIndicator`, meaning the `present` and `dismiss` methods will be called when the parent `UserIndicator` starts or completes.
class FullscreenLoadingViewPresenter: UserIndicatorViewPresentable {
private let label: String
private weak var viewController: UIViewController?
private let presentationContext: UserIndicatorPresentationContext
private weak var view: UIView?
private var animator: UIViewPropertyAnimator?
init(label: String, presentingViewController: UIViewController) {
init(label: String, presentationContext: UserIndicatorPresentationContext) {
self.label = label
self.viewController = presentingViewController
self.presentationContext = presentationContext
}
func present() {
// Find the current top navigation controller
var presentingController: UIViewController? = viewController
var presentingController: UIViewController? = presentationContext.indicatorPresentingViewController
while presentingController?.navigationController != nil {
presentingController = presentingController?.navigationController
}