Skip to content

Commit 13fffb7

Browse files
committed
feat(auth): add linkIdentity method
1 parent 76233bb commit 13fffb7

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

Sources/Auth/Internal/URLOpener.swift

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//
2+
// URLOpener.swift
3+
//
4+
//
5+
// Created by Guilherme Souza on 17/05/24.
6+
//
7+
8+
import Foundation
9+
10+
#if canImport(WatchKit)
11+
import WatchKit
12+
#endif
13+
14+
#if canImport(UIKit)
15+
import UIKit
16+
#endif
17+
18+
#if canImport(AppKit)
19+
import AppKit
20+
#endif
21+
22+
enum URLOpener {
23+
@MainActor
24+
static func open(_ url: URL) {
25+
#if os(macOS)
26+
NSWorkspace.shared.open(url)
27+
#elseif os(iOS) || os(tvOS) || os(visionOS) || targetEnvironment(macCatalyst)
28+
UIApplication.shared.open(url)
29+
#elseif os(watchOS)
30+
WKExtension.shared().openSystemURL(url)
31+
#endif
32+
}
33+
}

0 commit comments

Comments
 (0)