Skip to content

Commit

Permalink
Add visionOS and tvOS to client os info (#476)
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroshihorie authored Sep 5, 2024
1 parent 60057c4 commit 491a4e8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Sources/LiveKit/Support/Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,17 @@ typealias DebouncFunc = () -> Void
enum OS {
case macOS
case iOS
case visionOS
case tvOS
}

extension OS: CustomStringConvertible {
var description: String {
switch self {
case .macOS: return "macOS"
case .iOS: return "iOS"
case .visionOS: return "visionOS"
case .tvOS: return "tvOS"
}
}
}
Expand All @@ -56,10 +60,14 @@ class Utils {

/// Returns current OS.
static func os() -> OS {
#if os(iOS) || os(visionOS) || os(tvOS)
#if os(iOS)
.iOS
#elseif os(macOS)
.macOS
#elseif os(visionOS)
.visionOS
#elseif os(tvOS)
.tvOS
#endif
}

Expand Down

0 comments on commit 491a4e8

Please sign in to comment.