From 3f6bd7238c86d8e1c758a91c2dc29ec795fba4cf Mon Sep 17 00:00:00 2001 From: Mayur Nilwant Date: Mon, 19 Aug 2024 23:09:57 -0400 Subject: [PATCH] Removed callback that were added as part of completion callback. Deleted remove api that was added in navigationHandler. --- .../ActionPreviousSubmitHandler.swift | 3 -- .../ActionPreviousSubmitModel.swift | 28 +------------------ .../NavigationHandler.swift | 9 ------ 3 files changed, 1 insertion(+), 39 deletions(-) diff --git a/MVMCore/MVMCore/ActionHandling/ActionPreviousSubmitHandler.swift b/MVMCore/MVMCore/ActionHandling/ActionPreviousSubmitHandler.swift index c88feed..a3bded2 100644 --- a/MVMCore/MVMCore/ActionHandling/ActionPreviousSubmitHandler.swift +++ b/MVMCore/MVMCore/ActionHandling/ActionPreviousSubmitHandler.swift @@ -43,8 +43,5 @@ open class ActionPreviousSubmitHandler: MVMCoreJSONActionHandlerProtocol { } } } - if let _model = model as? ActionPreviousSubmitModel, let callBack = _model.completionHandler { - await callBack() - } } } diff --git a/MVMCore/MVMCore/ActionHandling/ActionPreviousSubmitModel.swift b/MVMCore/MVMCore/ActionHandling/ActionPreviousSubmitModel.swift index a242986..489aaf7 100644 --- a/MVMCore/MVMCore/ActionHandling/ActionPreviousSubmitModel.swift +++ b/MVMCore/MVMCore/ActionHandling/ActionPreviousSubmitModel.swift @@ -11,19 +11,11 @@ public struct ActionPreviousSubmitModel: ActionModelProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- - public typealias previousActionCompletion = (() async -> Void) + public static var identifier: String = "previousSubmit" public var actionType: String = ActionPreviousSubmitModel.identifier public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? - public var completionHandler : previousActionCompletion? - - private enum CodingKeys: String, CodingKey { - case actionType - case completionHandler - case extraParameters - case analyticsData - } //-------------------------------------------------- // MARK: - Initialzier @@ -34,24 +26,6 @@ public struct ActionPreviousSubmitModel: ActionModelProtocol { self.analyticsData = analyticsData } - public init(_ extraParameters: JSONValueDictionary? = nil, _ analyticsData: JSONValueDictionary? = nil, completionHandler handler: @escaping previousActionCompletion) { - self.init(extraParameters, analyticsData) - self.completionHandler = handler - } - - public init(from decoder: any Decoder) throws { - let typeContainer = try decoder.container(keyedBy: CodingKeys.self) - extraParameters = try typeContainer.decodeIfPresent(JSONValueDictionary.self, forKey: .extraParameters) - analyticsData = try typeContainer.decodeIfPresent(JSONValueDictionary.self, forKey: .analyticsData) - } - - public func encode(to encoder: any Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode(actionType, forKey: .actionType) - try container.encodeIfPresent(extraParameters, forKey: .extraParameters) - try container.encodeIfPresent(analyticsData, forKey: .analyticsData) - } - // Default public func isEqual(to model: any ModelComparisonProtocol) -> Bool { guard let model = model as? Self else { return false } diff --git a/MVMCore/MVMCore/PresentationHandling/NavigationHandler.swift b/MVMCore/MVMCore/PresentationHandling/NavigationHandler.swift index 2d96b78..ec27379 100644 --- a/MVMCore/MVMCore/PresentationHandling/NavigationHandler.swift +++ b/MVMCore/MVMCore/PresentationHandling/NavigationHandler.swift @@ -177,10 +177,6 @@ public class NavigationHandler { await navigate(with: .dismiss(viewController: presentedViewController), delegateObject: delegateObject) } - public func remove(viewController: UIViewController) async { - await self.navigationController?.removeViewController(viewController: viewController) - } - public func removeCurrentViewController(delegateObject: DelegateObject? = nil, animated: Bool = true) async { if let presentedViewController = await getTopMostPresentedViewController() { if let navigationController = (presentedViewController as? UINavigationController), @@ -221,11 +217,6 @@ public extension UINavigationController { func getViewControllers() -> [UIViewController] { NavigationHandler.shared().getViewControllers(for: self) } - - @objc @MainActor - func removeViewController(viewController: UIViewController) { - self.viewControllers.removeAll { $0 === viewController } - } } extension UIViewController {