We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6d07a94 commit d23a558Copy full SHA for d23a558
1 file changed
Packages/ClientRuntime/Sources/Util/PlatformOperationSystemVersion.swift
@@ -0,0 +1,24 @@
1
+//
2
+// Copyright Amazon.com Inc. or its affiliates.
3
+// All Rights Reserved.
4
5
+// SPDX-License-Identifier: Apache-2.0
6
7
+
8
+#if os(iOS) || os (watchOS) || os(macOS) || os(tvOS)
9
+import Foundation.NSProcessInfo
10
11
+public struct PlatformOperationSystemVersion {
12
+ static public func operatingSystemVersion() -> String? {
13
+ let osVersion = ProcessInfo.processInfo.operatingSystemVersion
14
+ return "\(osVersion.majorVersion).\(osVersion.minorVersion).\(osVersion.patchVersion)"
15
+ }
16
+}
17
+#else
18
+// TODO: Implement for Linux & Windows
19
20
21
+ return nil
22
23
24
+#endif
0 commit comments