Descriptor changes
This commit is contained in:
parent
cbb5ccded8
commit
36ec79f353
@ -21,7 +21,7 @@ open class ActionBackHandler: MVMCoreJSONActionHandlerProtocol {
|
||||
}
|
||||
|
||||
open func performAction(_ model: ActionModelProtocol, delegateObject: DelegateObject?, additionalData: [AnyHashable : Any]?) async throws {
|
||||
await withCheckedContinuation { (continuation: CheckedContinuation<Void, Never>) in
|
||||
await withCheckedContinuation { continuation in
|
||||
Task(priority: .userInitiated) {
|
||||
await MVMCoreNavigationHandler.shared()?.removeCurrentViewController(true, completionHandler: {
|
||||
continuation.resume()
|
||||
|
||||
@ -49,7 +49,8 @@ open class ActionOpenUrlHandler: MVMCoreJSONActionHandlerProtocol {
|
||||
}
|
||||
|
||||
/// Opens the url using UIApplication open(url:). Throws URLError.failedToOpen if it fails.
|
||||
@MainActor public static func open(url: URL) async throws {
|
||||
@MainActor
|
||||
public static func open(url: URL) async throws {
|
||||
try await withCheckedThrowingContinuation { continuation in
|
||||
UIApplication.shared.open(url, options: [:]) { successful in
|
||||
if successful {
|
||||
|
||||
@ -24,7 +24,8 @@ open class ActionShareHandler: MVMCoreActionHandlerProtocol {
|
||||
try await shareWith(activityItems: shareData, model: model)
|
||||
}
|
||||
|
||||
@MainActor open func shareWith(activityItems: [Any], model: ActionShareModel, delegateObject: DelegateObject? = nil) async throws {
|
||||
@MainActor
|
||||
open func shareWith(activityItems: [Any], model: ActionShareModel, delegateObject: DelegateObject? = nil) async throws {
|
||||
try await withCheckedThrowingContinuation { continuation in
|
||||
let controller = UIActivityViewController(activityItems: activityItems, applicationActivities: nil)
|
||||
controller.popoverPresentationController?.sourceView = MVMCoreNavigationHandler.shared()?.viewControllerToPresentOn?.view
|
||||
|
||||
@ -139,6 +139,7 @@ extension MVMCoreActionHandlerProtocol {
|
||||
}
|
||||
|
||||
/// Performs the action as a task and returns immediately.
|
||||
@discardableResult
|
||||
open func asyncHandleAction(with model: ActionModelProtocol, additionalData: [AnyHashable: Any]?, delegateObject: DelegateObject?) -> Task<Void, Error> {
|
||||
let task = Task(priority: .userInitiated) {
|
||||
try Task.checkCancellation()
|
||||
@ -173,9 +174,7 @@ extension MVMCoreActionHandlerProtocol {
|
||||
/// Subclass to log the action was fired.
|
||||
open func logAction(with model: ActionModelProtocol, additionalData: [AnyHashable: Any]?, delegateObject: DelegateObject?) {
|
||||
// Calls legacy log action function.
|
||||
Task {
|
||||
delegateObject?.actionDelegate?.logAction?(withActionInformation: model.toJSON(), additionalData: additionalData)
|
||||
}
|
||||
delegateObject?.actionDelegate?.logAction?(withActionInformation: model.toJSON(), additionalData: additionalData)
|
||||
}
|
||||
|
||||
/// Logs the error.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user