From 6877763d073a43f650501d6b73d45c5847c3a962 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Tue, 15 Aug 2023 16:24:46 -0400 Subject: [PATCH] remove intermediary work files --- .../MVMCoreNavigationPopOperation.swift | 43 ------------------- .../MVMCoreNavigationPresentOperation.swift | 32 -------------- .../MVMCoreNavigationPushOperation.swift | 38 ---------------- .../MVMCoreNavigationSetOperation.swift | 38 ---------------- 4 files changed, 151 deletions(-) delete mode 100644 MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationPopOperation.swift delete mode 100644 MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationPresentOperation.swift delete mode 100644 MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationPushOperation.swift delete mode 100644 MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationSetOperation.swift diff --git a/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationPopOperation.swift b/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationPopOperation.swift deleted file mode 100644 index e69897e..0000000 --- a/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationPopOperation.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// MVMCoreNavigationPopOperation.swift -// MVMCore -// -// Created by Scott Pfeil on 9/1/22. -// Copyright © 2022 myverizon. All rights reserved. -// - -import Foundation -import UIKit - -open class MVMCoreNavigationPopOperation: MVMCoreOperation, MVMCorePresentationDelegateProtocol { - open var navigationController: UINavigationController - open var animated: Bool - - private var previousViewController: UIViewController? - - public init(with navigationController: UINavigationController, animated: Bool = true) { - self.navigationController = navigationController - self.animated = animated - } - - open override func main() { - checkAndHandleForCancellation() - Task { @MainActor in - try Task.checkCancellation() - guard navigationController.viewControllers.count > 1 else { - markAsFinished() - return - } - previousViewController = navigationController.viewControllers[navigationController.viewControllers.count - 2] - MVMCoreNavigationHandler2.shared().add(delegate: self) - navigationController.popViewController(animated: animated) - } - } - - public func navigationController(_ navigationController: UINavigationController, displayedViewController viewController: UIViewController) { - guard self.navigationController == navigationController, - previousViewController == viewController else { return } - MVMCoreNavigationHandler2.shared().remove(delegate: self) - markAsFinished() - } -} diff --git a/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationPresentOperation.swift b/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationPresentOperation.swift deleted file mode 100644 index 0c73ddf..0000000 --- a/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationPresentOperation.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// MVMCorePresentViewControllerOperation.swift -// MVMCore -// -// Created by Scott Pfeil on 8/30/22. -// Copyright © 2022 myverizon. All rights reserved. -// - -import Foundation -import UIKit - -open class MVMCoreNavigationPresentOperation: MVMCoreOperation { - open var presentedViewController: UIViewController - open var presentingViewController: UIViewController - open var animated: Bool - - public init(with presentedViewController: UIViewController, presentingViewController: UIViewController, animated: Bool = true) { - self.presentedViewController = presentedViewController - self.presentingViewController = presentingViewController - self.animated = animated - } - - open override func main() { - checkAndHandleForCancellation() - Task { @MainActor in - try Task.checkCancellation() - presentingViewController.present(presentedViewController, animated: animated) { - self.markAsFinished() - } - } - } -} diff --git a/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationPushOperation.swift b/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationPushOperation.swift deleted file mode 100644 index 4f9159b..0000000 --- a/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationPushOperation.swift +++ /dev/null @@ -1,38 +0,0 @@ -// -// MVMCoreNavigationPushOperation.swift -// MVMCore -// -// Created by Scott Pfeil on 9/1/22. -// Copyright © 2022 myverizon. All rights reserved. -// - -import Foundation -import UIKit - -open class MVMCoreNavigationPushOperation: MVMCoreOperation, MVMCorePresentationDelegateProtocol { - open var viewController: UIViewController - open var navigationController: UINavigationController - open var animated: Bool - - public init(with viewController: UIViewController, navigationController: UINavigationController, animated: Bool = true) { - self.viewController = viewController - self.navigationController = navigationController - self.animated = animated - } - - open override func main() { - checkAndHandleForCancellation() - MVMCoreNavigationHandler2.shared().add(delegate: self) - Task { @MainActor in - try Task.checkCancellation() - navigationController.pushViewController(viewController, animated: animated) - } - } - - public func navigationController(_ navigationController: UINavigationController, displayedViewController viewController: UIViewController) { - guard self.navigationController == navigationController, - self.viewController == viewController else { return } - MVMCoreNavigationHandler2.shared().remove(delegate: self) - markAsFinished() - } -} diff --git a/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationSetOperation.swift b/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationSetOperation.swift deleted file mode 100644 index 4a28a74..0000000 --- a/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationSetOperation.swift +++ /dev/null @@ -1,38 +0,0 @@ -// -// MVMCoreNavigationSetOperation.swift -// MVMCore -// -// Created by Scott Pfeil on 9/1/22. -// Copyright © 2022 myverizon. All rights reserved. -// - -import Foundation -import UIKit - -open class MVMCoreNavigationSetOperation: MVMCoreOperation, MVMCorePresentationDelegateProtocol { - open var viewControllers: [UIViewController] - open var navigationController: UINavigationController - open var animated: Bool - - public init(with viewControllers: [UIViewController], navigationController: UINavigationController, animated: Bool = true) { - self.viewControllers = viewControllers - self.navigationController = navigationController - self.animated = animated - } - - open override func main() { - checkAndHandleForCancellation() - MVMCoreNavigationHandler2.shared().add(delegate: self) - Task { @MainActor in - try Task.checkCancellation() - navigationController.setViewControllers(viewControllers, animated: animated) - } - } - - public func navigationController(_ navigationController: UINavigationController, displayedViewController viewController: UIViewController) { - guard self.navigationController == navigationController, - viewControllers.last == viewController else { return } - MVMCoreNavigationHandler2.shared().remove(delegate: self) - markAsFinished() - } -}