diff --git a/FRDIntent.podspec b/FRDIntent.podspec index dce0b0a..d8b6967 100644 --- a/FRDIntent.podspec +++ b/FRDIntent.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "FRDIntent" - s.version = "0.10.4" + s.version = "0.10.5" s.summary = "FRDIntent can handle the call between view controller" s.description = "FRDIntent has two components URLRoutes and Intent, using for calling view controllers inner app or outer app." diff --git a/FRDIntent/Source/Intent/FRDControllerManager.swift b/FRDIntent/Source/Intent/FRDControllerManager.swift index 5a5fabb..88ce59b 100644 --- a/FRDIntent/Source/Intent/FRDControllerManager.swift +++ b/FRDIntent/Source/Intent/FRDControllerManager.swift @@ -77,6 +77,7 @@ public class FRDControllerManager: NSObject { - parameter source: The source view controller. - parameter intent: The intent for launch a new view controller. */ + @MainActor @objc public func startController(from source: UIViewController, with intent: FRDIntent) { var parameters = [String: Any]() @@ -124,6 +125,7 @@ public class FRDControllerManager: NSObject { - parameter intent: The intent for start new view controller. - parameter requestCode : this code will be returned in onControllerResult() when the view controller exits. */ + @MainActor @objc public func startControllerForResult(from source: UIViewController, with intent: FRDIntent, requestCode: Int) { typealias ControllerType = FRDIntentForResultReceivable.Type @@ -170,6 +172,7 @@ public class FRDControllerManager: NSObject { } + @MainActor private func viewController(fromClazz clazz: FRDIntentReceivable.Type?, extras: [String: Any]) -> FRDIntentReceivable? { guard let controllerClass = clazz else { return nil } return controllerClass.init(extras: extras) diff --git a/FRDIntent/Source/Intent/FRDIntentReceivable.swift b/FRDIntent/Source/Intent/FRDIntentReceivable.swift index 4f842b9..8dafb79 100644 --- a/FRDIntent/Source/Intent/FRDIntentReceivable.swift +++ b/FRDIntent/Source/Intent/FRDIntentReceivable.swift @@ -18,5 +18,6 @@ import Foundation - parameter extras: The extra data. */ + @MainActor init?(extras: [String: Any]) } diff --git a/FRDIntent/Source/URLRoutes/FRDURLRoutes.swift b/FRDIntent/Source/URLRoutes/FRDURLRoutes.swift index 14e5671..a3e91fb 100644 --- a/FRDIntent/Source/URLRoutes/FRDURLRoutes.swift +++ b/FRDIntent/Source/URLRoutes/FRDURLRoutes.swift @@ -88,7 +88,9 @@ public extension FRDURLRoutes { guard let url = params[RouteManager.URLRouteURL] as? URL else { return } let intent = FRDIntent(url: url) if let topViewController = UIApplication.topViewController() { - FRDControllerManager.sharedInstance.startController(from: topViewController, with: intent) + MainActor.assumeIsolated { + FRDControllerManager.sharedInstance.startController(from: topViewController, with: intent) + } } }