make battery state unavailable on tvOS

This commit is contained in:
Dennis Weissmann
2018-10-11 21:57:21 +02:00
parent be05efba2d
commit ef0b3aaf91
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -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 {
+6
View File
@@ -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 {