Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion FRDIntent.podspec
Original file line number Diff line number Diff line change
@@ -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."
Expand Down
3 changes: 3 additions & 0 deletions FRDIntent/Source/Intent/FRDControllerManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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]()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions FRDIntent/Source/Intent/FRDIntentReceivable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ import Foundation

- parameter extras: The extra data.
*/
@MainActor
init?(extras: [String: Any])
}
4 changes: 3 additions & 1 deletion FRDIntent/Source/URLRoutes/FRDURLRoutes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}

Expand Down