Skip to content

Commit f19f9f8

Browse files
Zandor300denisenepraunig
authored andcommitted
Rename the Apple TV HD enum to appleTVHD. (devicekit#211)
* Rename the Apple TV HD enum to appleTVHD. Breaking change! * Update changelog. * Update tests with appleTVHD rename.
1 parent 81ca67d commit f19f9f8

File tree

4 files changed

+27
-13
lines changed

4 files changed

+27
-13
lines changed

CHANGELOG.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,37 @@
11
# Changelog
22

3-
## Version 2.3.0
3+
## Version 3.0.0
44

5-
Releasedate: 2019-10-02
5+
Releasedate: TBD
66

77
```ruby
88
pod 'DeviceKit', :git => 'https://github.com/devicekit/DeviceKit.git', :branch => 'master'
99
```
1010

11-
### New devices
12-
- Added support for the new september 2019 devices:
13-
- iPad (7th generation)
11+
### Breaking changes
12+
- The enum for the Apple TV HD has been renamed from `.appleTV4` to `.appleTVHD`. (#211)
13+
14+
### New features
15+
- You can now check which devices support wireless charging through the following variables: `Device.allDevicesWithWirelessChargingSupport` and `Device.current.supportsWirelessCharging` (#209)
16+
17+
## Version 2.3.0
18+
19+
Releasedate: 2019-10-02
20+
21+
```ruby
22+
pod 'DeviceKit', '~> 2.3'
23+
```
24+
25+
### New devices
26+
- Added support for the new september 2019 devices:
27+
- iPad (7th generation)
1428

1529
## Version 2.2.0
1630

1731
Releasedate: 2019-09-24
1832

1933
```ruby
20-
pod 'DeviceKit', :git => 'https://github.com/devicekit/DeviceKit.git', :branch => 'master'
34+
pod 'DeviceKit', '~> 2.2'
2135
```
2236

2337
### New devices

Source/Device.generated.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ public enum Device {
232232
/// Device is an [Apple TV HD](https://support.apple.com/kb/SP724) (Previously Apple TV (4th generation))
233233
///
234234
/// ![Image](http://images.apple.com/v/tv/c/images/overview/buy_tv_large_2x.jpg)
235-
case appleTV4
235+
case appleTVHD
236236
/// Device is an [Apple TV 4K](https://support.apple.com/kb/SP769)
237237
///
238238
/// ![Image](https://support.apple.com/library/APPLE/APPLECARE_ALLGEOS/SP769/appletv4k.png)
@@ -374,7 +374,7 @@ public enum Device {
374374
}
375375
#elseif os(tvOS)
376376
switch identifier {
377-
case "AppleTV5,3": return appleTV4
377+
case "AppleTV5,3": return appleTVHD
378378
case "AppleTV6,2": return appleTV4K
379379
case "i386", "x86_64": return simulator(mapToDevice(identifier: ProcessInfo().environment["SIMULATOR_MODEL_IDENTIFIER"] ?? "tvOS"))
380380
default: return unknown(identifier)
@@ -741,7 +741,7 @@ public enum Device {
741741
#elseif os(tvOS)
742742
/// All TVs
743743
public static var allTVs: [Device] {
744-
return [.appleTV4, .appleTV4K]
744+
return [.appleTVHD, .appleTV4K]
745745
}
746746

747747
/// All simulator TVs
@@ -1045,7 +1045,7 @@ extension Device: CustomStringConvertible {
10451045
}
10461046
#elseif os(tvOS)
10471047
switch self {
1048-
case .appleTV4: return "Apple TV HD"
1048+
case .appleTVHD: return "Apple TV HD"
10491049
case .appleTV4K: return "Apple TV 4K"
10501050
case .simulator(let model): return "Simulator (\(model))"
10511051
case .unknown(let identifier): return identifier

Source/Device.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ homePods = [
9292
]
9393
# tvOS
9494
tvs = [
95-
Device("appleTV4", "Device is an [Apple TV HD](https://support.apple.com/kb/SP724) (Previously Apple TV (4th generation))", "http://images.apple.com/v/tv/c/images/overview/buy_tv_large_2x.jpg", ["AppleTV5,3"], 0, (), "Apple TV HD", -1, False, False, False, False, False, False, False, False, False, 0, False, 0),
95+
Device("appleTVHD", "Device is an [Apple TV HD](https://support.apple.com/kb/SP724) (Previously Apple TV (4th generation))", "http://images.apple.com/v/tv/c/images/overview/buy_tv_large_2x.jpg", ["AppleTV5,3"], 0, (), "Apple TV HD", -1, False, False, False, False, False, False, False, False, False, 0, False, 0),
9696
Device("appleTV4K", "Device is an [Apple TV 4K](https://support.apple.com/kb/SP769)", "https://support.apple.com/library/APPLE/APPLECARE_ALLGEOS/SP769/appletv4k.png", ["AppleTV6,2"], 0, (), "Apple TV 4K", -1, False, False, False, False, False, False, False, False, False, 0, False, 0)
9797
]
9898

Tests/Tests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,10 +429,10 @@ class DeviceKitTests: XCTestCase {
429429
func testPPI() {
430430
// Non-applicable devices:
431431
// Apple TV
432-
XCTAssertEqual(Device.appleTV4.ppi, nil)
432+
XCTAssertEqual(Device.appleTVHD.ppi, nil)
433433
XCTAssertEqual(Device.appleTV4K.ppi, nil)
434434
// Simulators
435-
XCTAssertEqual(Device.simulator(Device.appleTV4).ppi, nil)
435+
XCTAssertEqual(Device.simulator(Device.appleTVHD).ppi, nil)
436436
XCTAssertEqual(Device.simulator(Device.appleTV4K).ppi, nil)
437437
}
438438

0 commit comments

Comments
 (0)