mirror of
https://github.com/devicekit/DeviceKit.git
synced 2026-06-16 10:24:30 +00:00
make battery state unavailable on tvOS
This commit is contained in:
@@ -481,6 +481,8 @@ public enum Device {
|
||||
case .simulator(let model): return model.screenRatio
|
||||
case .unknown: return (width: -1, height: -1)
|
||||
}
|
||||
#elseif os(tvOS)
|
||||
return (width: -1, height: -1)
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -908,6 +910,7 @@ extension Device: Equatable {
|
||||
}
|
||||
|
||||
// MARK: - Battery
|
||||
#if os(iOS) || os(watchOS)
|
||||
@available(iOS 8.0, watchOS 4.0, *)
|
||||
extension Device {
|
||||
/**
|
||||
@@ -998,8 +1001,10 @@ extension Device {
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
// MARK: - Device.Batterystate: Comparable
|
||||
#if os(iOS) || os(watchOS)
|
||||
@available(iOS 8.0, watchOS 4.0, *)
|
||||
extension Device.BatteryState: Comparable {
|
||||
/// Tells if two battery states are equal.
|
||||
@@ -1030,6 +1035,7 @@ extension Device.BatteryState: Comparable {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if os(iOS)
|
||||
extension Device {
|
||||
|
||||
@@ -337,6 +337,8 @@ public enum Device {
|
||||
case .simulator(let model): return model.screenRatio
|
||||
case .unknown: return (width: -1, height: -1)
|
||||
}
|
||||
#elseif os(tvOS)
|
||||
return (width: -1, height: -1)
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -685,6 +687,7 @@ extension Device: Equatable {
|
||||
}
|
||||
|
||||
// MARK: - Battery
|
||||
#if os(iOS) || os(watchOS)
|
||||
@available(iOS 8.0, watchOS 4.0, *)
|
||||
extension Device {
|
||||
/**
|
||||
@@ -775,8 +778,10 @@ extension Device {
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
// MARK: - Device.Batterystate: Comparable
|
||||
#if os(iOS) || os(watchOS)
|
||||
@available(iOS 8.0, watchOS 4.0, *)
|
||||
extension Device.BatteryState: Comparable {
|
||||
/// Tells if two battery states are equal.
|
||||
@@ -807,6 +812,7 @@ extension Device.BatteryState: Comparable {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if os(iOS)
|
||||
extension Device {
|
||||
|
||||
Reference in New Issue
Block a user