We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 76233bb commit 13fffb7Copy full SHA for 13fffb7
Sources/Auth/Internal/URLOpener.swift
@@ -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
17
18
+#if canImport(AppKit)
19
+ import AppKit
20
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