Skip to content

Commit

Permalink
Update deeplink
Browse files Browse the repository at this point in the history
  • Loading branch information
juicyfru1t committed Oct 1, 2024
1 parent 3225f32 commit 2e2ce74
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions Sources/Deeplink/AnyDeeplink.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Foundation
/// Erased type of ``Deeplink`` protocol.
///
/// - SeeAlso: ``Deeplink``
@MainActor
public protocol AnyDeeplink {

/// The default implementation casts `screens` to the ``Deeplink/Screens`` type
Expand Down
2 changes: 2 additions & 0 deletions Sources/Deeplink/Deeplink.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public protocol Deeplink: AnyDeeplink {
/// - screens: Screen Factory.
/// - navigator: Navigator for performing navigation actions.
/// - handler: Handler for processing a new ``Deeplink``
@MainActor
func navigate(
screens: Screens,
navigator: ScreenNavigator,
Expand Down Expand Up @@ -70,6 +71,7 @@ extension Deeplink {

extension Deeplink {

@MainActor
public func navigateIfPossible(
screens: Any?,
navigator: ScreenNavigator,
Expand Down
1 change: 1 addition & 0 deletions Sources/Deeplink/DeeplinkHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import UserNotifications
/// The handler converts the external source (URL, Push-Notification, Shortcut)
/// into a suitable ``Deeplink`` to make the navigation.
/// If no suitable ``Deeplink`` was found, the handler methods will return `false`.
@MainActor
public protocol DeeplinkHandler {

/// Returns a Boolean value that indicates whether ``URLDeeplink`` exists to handle the URL.
Expand Down
4 changes: 3 additions & 1 deletion Sources/Deeplink/DeeplinkManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,9 @@ public final class DeeplinkManager: DeeplinkHandler {
object: nil,
queue: nil
) { [weak self] _ in
self?.navigateIfPossible()
Task { @MainActor in
self?.navigateIfPossible()
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/Deeplink/DeeplinkScope.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Foundation
///
/// The scope allows you to split deep links by activating and deactivating each scope independently.
/// See ``DeeplinkManager`` for details.
public struct DeeplinkScope: Hashable, ExpressibleByStringLiteral {
public struct DeeplinkScope: Hashable, ExpressibleByStringLiteral, Sendable {

/// A unique key for identifying a scope.
public let key: String?
Expand Down

0 comments on commit 2e2ce74

Please sign in to comment.