Removed callback that were added as part of completion callback.

Deleted remove api that was added in navigationHandler.
This commit is contained in:
Mayur Nilwant 2024-08-19 23:09:57 -04:00
parent bf4fd7543a
commit 3f6bd7238c
3 changed files with 1 additions and 39 deletions

View File

@ -43,8 +43,5 @@ open class ActionPreviousSubmitHandler: MVMCoreJSONActionHandlerProtocol {
}
}
}
if let _model = model as? ActionPreviousSubmitModel, let callBack = _model.completionHandler {
await callBack()
}
}
}

View File

@ -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 }

View File

@ -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 {