File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -12,12 +12,21 @@ private let _version = "2.26.0" // {x-release-please-version}
1212private let _platform : String ? = {
1313 #if os(macOS)
1414 return " macOS "
15+ #elseif os(visionOS)
16+ return " visionOS "
1517 #elseif os(iOS)
16- return " iOS "
17- #elseif os(tvOS)
18- return " tvOS "
18+ #if targetEnvironment(macCatalyst)
19+ return " macCatalyst "
20+ #else
21+ if #available( iOS 14 . 0 , * ) , ProcessInfo . processInfo. isiOSAppOnMac {
22+ return " iOSAppOnMac "
23+ }
24+ return " iOS "
25+ #endif
1926 #elseif os(watchOS)
2027 return " watchOS "
28+ #elseif os(tvOS)
29+ return " tvOS "
2130 #elseif os(Android)
2231 return " Android "
2332 #elseif os(Linux)
@@ -31,7 +40,10 @@ private let _platform: String? = {
3140
3241private let _platformVersion : String ? = {
3342 #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) || os(Windows)
34- ProcessInfo . processInfo. operatingSystemVersionString
43+ let majorVersion = ProcessInfo . processInfo. operatingSystemVersion. majorVersion
44+ let minorVersion = ProcessInfo . processInfo. operatingSystemVersion. minorVersion
45+ let patchVersion = ProcessInfo . processInfo. operatingSystemVersion. patchVersion
46+ return " \( majorVersion) . \( minorVersion) . \( patchVersion) "
3547 #elseif os(Linux) || os(Android)
3648 if let version = try ? String ( contentsOfFile: " /proc/version " ) {
3749 version. trimmingCharacters ( in: . whitespacesAndNewlines)
You can’t perform that action at this time.
0 commit comments