From ef0b3aaf9155feae7df4ea86cdbeaf575030cdfb Mon Sep 17 00:00:00 2001 From: Dennis Weissmann Date: Thu, 11 Oct 2018 21:57:21 +0200 Subject: [PATCH] make battery state unavailable on tvOS --- Source/Device.generated.swift | 6 ++++++ Source/Device.swift.gyb | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/Source/Device.generated.swift b/Source/Device.generated.swift index fdf9f27..d880f4b 100644 --- a/Source/Device.generated.swift +++ b/Source/Device.generated.swift @@ -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 { diff --git a/Source/Device.swift.gyb b/Source/Device.swift.gyb index c0c5d6a..631f207 100644 --- a/Source/Device.swift.gyb +++ b/Source/Device.swift.gyb @@ -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 {