Removed callback that were added as part of completion callback.
Deleted remove api that was added in navigationHandler.
This commit is contained in:
parent
bf4fd7543a
commit
3f6bd7238c
@ -43,8 +43,5 @@ open class ActionPreviousSubmitHandler: MVMCoreJSONActionHandlerProtocol {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let _model = model as? ActionPreviousSubmitModel, let callBack = _model.completionHandler {
|
|
||||||
await callBack()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,19 +11,11 @@ public struct ActionPreviousSubmitModel: ActionModelProtocol {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Properties
|
// MARK: - Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
public typealias previousActionCompletion = (() async -> Void)
|
|
||||||
public static var identifier: String = "previousSubmit"
|
public static var identifier: String = "previousSubmit"
|
||||||
public var actionType: String = ActionPreviousSubmitModel.identifier
|
public var actionType: String = ActionPreviousSubmitModel.identifier
|
||||||
public var extraParameters: JSONValueDictionary?
|
public var extraParameters: JSONValueDictionary?
|
||||||
public var analyticsData: JSONValueDictionary?
|
public var analyticsData: JSONValueDictionary?
|
||||||
public var completionHandler : previousActionCompletion?
|
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
|
||||||
case actionType
|
|
||||||
case completionHandler
|
|
||||||
case extraParameters
|
|
||||||
case analyticsData
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Initialzier
|
// MARK: - Initialzier
|
||||||
@ -34,24 +26,6 @@ public struct ActionPreviousSubmitModel: ActionModelProtocol {
|
|||||||
self.analyticsData = analyticsData
|
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
|
// Default
|
||||||
public func isEqual(to model: any ModelComparisonProtocol) -> Bool {
|
public func isEqual(to model: any ModelComparisonProtocol) -> Bool {
|
||||||
guard let model = model as? Self else { return false }
|
guard let model = model as? Self else { return false }
|
||||||
|
|||||||
@ -177,10 +177,6 @@ public class NavigationHandler {
|
|||||||
await navigate(with: .dismiss(viewController: presentedViewController), delegateObject: delegateObject)
|
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 {
|
public func removeCurrentViewController(delegateObject: DelegateObject? = nil, animated: Bool = true) async {
|
||||||
if let presentedViewController = await getTopMostPresentedViewController() {
|
if let presentedViewController = await getTopMostPresentedViewController() {
|
||||||
if let navigationController = (presentedViewController as? UINavigationController),
|
if let navigationController = (presentedViewController as? UINavigationController),
|
||||||
@ -221,11 +217,6 @@ public extension UINavigationController {
|
|||||||
func getViewControllers() -> [UIViewController] {
|
func getViewControllers() -> [UIViewController] {
|
||||||
NavigationHandler.shared().getViewControllers(for: self)
|
NavigationHandler.shared().getViewControllers(for: self)
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc @MainActor
|
|
||||||
func removeViewController(viewController: UIViewController) {
|
|
||||||
self.viewControllers.removeAll { $0 === viewController }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension UIViewController {
|
extension UIViewController {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user