diff --git a/Source/Device.generated.swift b/Source/Device.generated.swift index 586620f..d8f3765 100644 --- a/Source/Device.generated.swift +++ b/Source/Device.generated.swift @@ -2100,7 +2100,7 @@ extension Device { } #endif -#if os(iOS) +#if os(iOS) || os(tvOS) // MARK: DiskSpace extension Device { @@ -2118,7 +2118,11 @@ extension Device { public static var volumeAvailableCapacity: Int? { return (try? rootURL.resourceValues(forKeys: [.volumeAvailableCapacityKey]))?.volumeAvailableCapacity } +} +#endif +#if os(iOS) +extension Device { /// The volume’s available capacity in bytes for storing important resources. @available(iOS 11.0, *) public static var volumeAvailableCapacityForImportantUsage: Int64? { diff --git a/Source/Device.swift.gyb b/Source/Device.swift.gyb index 94e3399..dc0c654 100644 --- a/Source/Device.swift.gyb +++ b/Source/Device.swift.gyb @@ -1241,7 +1241,7 @@ extension Device { } #endif -#if os(iOS) +#if os(iOS) || os(tvOS) // MARK: DiskSpace extension Device { @@ -1259,7 +1259,11 @@ extension Device { public static var volumeAvailableCapacity: Int? { return (try? rootURL.resourceValues(forKeys: [.volumeAvailableCapacityKey]))?.volumeAvailableCapacity } +} +#endif +#if os(iOS) +extension Device { /// The volume’s available capacity in bytes for storing important resources. @available(iOS 11.0, *) public static var volumeAvailableCapacityForImportantUsage: Int64? { diff --git a/Tests/Tests.swift b/Tests/Tests.swift index f14418f..3cce097 100644 --- a/Tests/Tests.swift +++ b/Tests/Tests.swift @@ -584,17 +584,20 @@ class DeviceKitTests: XCTestCase { } } + #if os(iOS) || os(tvOS) // MARK: - volumes - @available(iOS 11.0, *) + @available(iOS 11.0, tvOS 11.0, *) func testVolumeTotalCapacity() { XCTAssertNotNil(Device.volumeTotalCapacity) } - @available(iOS 11.0, *) + @available(iOS 11.0, tvOS 11.0, *) func testVolumeAvailableCapacity() { XCTAssertNotNil(Device.volumeAvailableCapacity) } + #endif + #if os(iOS) @available(iOS 11.0, *) func testVolumeAvailableCapacityForImportantUsage() { XCTAssertNotNil(Device.volumeAvailableCapacityForImportantUsage) @@ -609,6 +612,7 @@ class DeviceKitTests: XCTestCase { func testVolumes() { XCTAssertNotNil(Device.volumes) } + #endif func testCameras() { for device in Device.allDevicesWithCamera {