Skip to content

Commit

Permalink
Merge pull request #7 from SlaunchaMan/fall-2020-devices
Browse files Browse the repository at this point in the history
Updates for Fall 2020 devices.
  • Loading branch information
SlaunchaMan committed Sep 17, 2020
2 parents 1f77206 + 040e64b commit fe91a28
Show file tree
Hide file tree
Showing 12 changed files with 128 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,12 @@
# Orchard Change Log

## [1.7.0](https://github.com/SlaunchaMan/Orchard/releases/tag/1.7.0)
**Released:** 2020-09-17

### Added
- Support for Apple Watch SE and Apple Watch Series 6.
- Support for iPad (8th Generation) and iPad Air (4th Generation).

## [1.6.1](https://github.com/SlaunchaMan/Orchard/releases/tag/1.6.1)
**Released:** 2020-08-05

Expand Down
2 changes: 1 addition & 1 deletion Common/GYBUtilities.py
Expand Up @@ -75,4 +75,4 @@ def needsAvailabilityCheck(version, os = OSFamily.IOS):
return versiontuple(version) > minimum

def enumName(x):
return x.replace(" ", "").replace("(", "").replace(")","").replace(".", "_").replace("-", "").replace(",", "").replace("mini", "Mini").replace("Generation", "").replace("inch", "Inch").replace("1st", "").replace("2nd", "2").replace("3rd", "3").replace("4th", "4").replace("5th", "5").replace("6th", "6").replace("7th", "7").replace("touch", "Touch")
return x.replace(" ", "").replace("(", "").replace(")","").replace(".", "_").replace("-", "").replace(",", "").replace("mini", "Mini").replace("Generation", "").replace("inch", "Inch").replace("1st", "").replace("2nd", "2").replace("3rd", "3").replace("4th", "4").replace("5th", "5").replace("6th", "6").replace("7th", "7").replace("8th", "8").replace("touch", "Touch")
4 changes: 4 additions & 0 deletions Data/Watches.tsv
Expand Up @@ -11,3 +11,7 @@ Apple Watch Series 4 40mm 5.0 Watch4,1;Watch4,3
Apple Watch Series 4 44mm 5.0 Watch4,2;Watch4,4
Apple Watch Series 5 40mm 6.0 Watch5,1;Watch5,3
Apple Watch Series 5 44mm 6.0 Watch5,2;Watch5,4
Apple Watch SE 40mm 7.0 Watch5,9;Watch5,11
Apple Watch SE 44mm 7.0 Watch5,10;Watch5,12
Apple Watch Series 6 40mm 7.0 Watch6,1;Watch6,3
Apple Watch Series 6 44mm 7.0 Watch6,2;Watch6,4
2 changes: 2 additions & 0 deletions Data/iPads.tsv
Expand Up @@ -22,3 +22,5 @@ iPad Air (3rd Generation) 12.2 iPad11,3;iPad11,4
iPad (7th Generation) 13.1 iPad7,11;iPad7,12
iPad Pro (11-inch) (2nd Generation) 13.4 iPad8,9;iPad8,10
iPad Pro (12.9-inch) (4th Generation) 13.4 iPad8,11;iPad8,12
iPad (8th Generation) 14.0 iPad11,6;iPad11,7
iPad Air (4th Generation) 14.0 iPad13,1
2 changes: 2 additions & 0 deletions Orchard-ObjC/iOS/OrchardiOSDevice.h
Expand Up @@ -76,6 +76,8 @@ typedef NS_ENUM(NSUInteger, OrchardiOSDevice) {
OrchardiOSDeviceiPad7 NS_ENUM_AVAILABLE_IOS(13.1) NS_SWIFT_NAME(iPad7),
OrchardiOSDeviceiPadPro11Inch2 NS_ENUM_AVAILABLE_IOS(13.4) NS_SWIFT_NAME(iPadPro11Inch2),
OrchardiOSDeviceiPadPro12_9Inch4 NS_ENUM_AVAILABLE_IOS(13.4) NS_SWIFT_NAME(iPadPro12_9Inch4),
OrchardiOSDeviceiPad8 NS_ENUM_AVAILABLE_IOS(14.0) NS_SWIFT_NAME(iPad8),
OrchardiOSDeviceiPadAir4 NS_ENUM_AVAILABLE_IOS(14.0) NS_SWIFT_NAME(iPadAir4),

// iPods
OrchardiOSDeviceiPodTouch NS_ENUM_DEPRECATED_IOS(1.1, 3.2) NS_SWIFT_NAME(iPodTouch),
Expand Down
15 changes: 15 additions & 0 deletions Orchard-ObjC/iOS/OrchardiOSDevice.m
Expand Up @@ -219,6 +219,13 @@ OrchardiOSDevice OrchardiOSDeviceFromNSString(NSString * _Nonnull string) {
@"iPad8,12"]]) {
return OrchardiOSDeviceiPadPro12_9Inch4;
}
else if ([string orchard_isEqualToOneOfStrings:@[@"iPad11,6",
@"iPad11,7"]]) {
return OrchardiOSDeviceiPad8;
}
else if ([string isEqualToString:@"iPad13,1"]) {
return OrchardiOSDeviceiPadAir4;
}

#pragma mark - iPods

Expand Down Expand Up @@ -313,6 +320,8 @@ OrchardiOSDeviceFamily OrchardiOSDeviceFamilyForiOSDevice(OrchardiOSDevice devic
case OrchardiOSDeviceiPad7:
case OrchardiOSDeviceiPadPro11Inch2:
case OrchardiOSDeviceiPadPro12_9Inch4:
case OrchardiOSDeviceiPad8:
case OrchardiOSDeviceiPadAir4:
return OrchardiOSDeviceFamilyiPad;

#pragma mark - iPods
Expand Down Expand Up @@ -497,6 +506,12 @@ OrchardiOSDeviceFamily OrchardiOSDeviceFamilyForiOSDevice(OrchardiOSDevice devic
case OrchardiOSDeviceiPadPro12_9Inch4:
return @"iPad Pro (12.9-inch) (4th Generation)";

case OrchardiOSDeviceiPad8:
return @"iPad (8th Generation)";

case OrchardiOSDeviceiPadAir4:
return @"iPad Air (4th Generation)";

#pragma mark - iPods

case OrchardiOSDeviceiPodTouch:
Expand Down
4 changes: 4 additions & 0 deletions Orchard-ObjC/watchOS/OrchardwatchOSDevice.h
Expand Up @@ -29,6 +29,10 @@ typedef NS_ENUM(NSUInteger, OrchardwatchOSDevice) {
OrchardwatchOSDeviceAppleWatchSeries4_44mm NS_ENUM_AVAILABLE_IOS(12.0) NS_SWIFT_NAME(AppleWatchSeries4_44mm),
OrchardwatchOSDeviceAppleWatchSeries5_40mm NS_ENUM_AVAILABLE_IOS(13.0) NS_SWIFT_NAME(AppleWatchSeries5_40mm),
OrchardwatchOSDeviceAppleWatchSeries5_44mm NS_ENUM_AVAILABLE_IOS(13.0) NS_SWIFT_NAME(AppleWatchSeries5_44mm),
OrchardwatchOSDeviceAppleWatchSE_40mm NS_ENUM_AVAILABLE_IOS(14.0) NS_SWIFT_NAME(AppleWatchSE_40mm),
OrchardwatchOSDeviceAppleWatchSE_44mm NS_ENUM_AVAILABLE_IOS(14.0) NS_SWIFT_NAME(AppleWatchSE_44mm),
OrchardwatchOSDeviceAppleWatchSeries6_40mm NS_ENUM_AVAILABLE_IOS(14.0) NS_SWIFT_NAME(AppleWatchSeries6_40mm),
OrchardwatchOSDeviceAppleWatchSeries6_44mm NS_ENUM_AVAILABLE_IOS(14.0) NS_SWIFT_NAME(AppleWatchSeries6_44mm),

OrchardwatchOSDeviceSimulator NS_SWIFT_NAME(simulator),
OrchardwatchOSDeviceUnknown NS_SWIFT_NAME(unknown)
Expand Down
36 changes: 36 additions & 0 deletions Orchard-ObjC/watchOS/OrchardwatchOSDevice.m
Expand Up @@ -82,6 +82,30 @@ OrchardwatchOSDevice OrchardwatchOSDeviceFromNSString(NSString *string) {
return OrchardwatchOSDeviceAppleWatchSeries5_44mm;
}
}
else if ([string orchard_isEqualToOneOfStrings:@[@"Watch5,9",
@"Watch5,11"]]) {
if (@available(watchOS 7.0, *)) {
return OrchardwatchOSDeviceAppleWatchSE_40mm;
}
}
else if ([string orchard_isEqualToOneOfStrings:@[@"Watch5,10",
@"Watch5,12"]]) {
if (@available(watchOS 7.0, *)) {
return OrchardwatchOSDeviceAppleWatchSE_44mm;
}
}
else if ([string orchard_isEqualToOneOfStrings:@[@"Watch6,1",
@"Watch6,3"]]) {
if (@available(watchOS 7.0, *)) {
return OrchardwatchOSDeviceAppleWatchSeries6_40mm;
}
}
else if ([string orchard_isEqualToOneOfStrings:@[@"Watch6,2",
@"Watch6,4"]]) {
if (@available(watchOS 7.0, *)) {
return OrchardwatchOSDeviceAppleWatchSeries6_44mm;
}
}

return OrchardwatchOSDeviceUnknown;
}
Expand Down Expand Up @@ -129,6 +153,18 @@ OrchardwatchOSDevice OrchardwatchOSDeviceFromNSString(NSString *string) {
case OrchardwatchOSDeviceAppleWatchSeries5_44mm:
return @"Apple Watch Series 5 (44mm)";

case OrchardwatchOSDeviceAppleWatchSE_40mm:
return @"Apple Watch SE (40mm)";

case OrchardwatchOSDeviceAppleWatchSE_44mm:
return @"Apple Watch SE (44mm)";

case OrchardwatchOSDeviceAppleWatchSeries6_40mm:
return @"Apple Watch Series 6 (40mm)";

case OrchardwatchOSDeviceAppleWatchSeries6_44mm:
return @"Apple Watch Series 6 (44mm)";

default:
break;
}
Expand Down
18 changes: 18 additions & 0 deletions Orchard-Swift/iOS/iPads.swift
Expand Up @@ -82,6 +82,12 @@ public enum iPads {
@available (iOS, introduced: 13.4)
case iPadPro12_9Inch4

@available (iOS, introduced: 14.0)
case iPad8

@available (iOS, introduced: 14.0)
case iPadAir4

case unknown

internal init(model: String) {
Expand Down Expand Up @@ -187,6 +193,16 @@ public enum iPads {
self = .iPadPro12_9Inch4
}

case "iPad11,6", "iPad11,7":
if #available(iOS 14.0, *) {
self = .iPad8
}

case "iPad13,1":
if #available(iOS 14.0, *) {
self = .iPadAir4
}

default: break

}
Expand Down Expand Up @@ -217,6 +233,8 @@ public enum iPads {
case .iPad7: return "iPad (7th Generation)"
case .iPadPro11Inch2: return "iPad Pro (11-inch) (2nd Generation)"
case .iPadPro12_9Inch4: return "iPad Pro (12.9-inch) (4th Generation)"
case .iPad8: return "iPad (8th Generation)"
case .iPadAir4: return "iPad Air (4th Generation)"

default: return nil
}
Expand Down
36 changes: 36 additions & 0 deletions Orchard-Swift/watchOS/Watches.swift
Expand Up @@ -49,6 +49,18 @@ public enum Watches {
@available (watchOS, introduced: 6.0)
case AppleWatchSeries5_44mm

@available (watchOS, introduced: 7.0)
case AppleWatchSE_40mm

@available (watchOS, introduced: 7.0)
case AppleWatchSE_44mm

@available (watchOS, introduced: 7.0)
case AppleWatchSeries6_40mm

@available (watchOS, introduced: 7.0)
case AppleWatchSeries6_44mm

case unknown

internal init(model: String) {
Expand Down Expand Up @@ -111,6 +123,26 @@ public enum Watches {
self = .AppleWatchSeries5_44mm
}

case "Watch5,9", "Watch5,11":
if #available(watchOS 7.0, *) {
self = .AppleWatchSE_40mm
}

case "Watch5,10", "Watch5,12":
if #available(watchOS 7.0, *) {
self = .AppleWatchSE_44mm
}

case "Watch6,1", "Watch6,3":
if #available(watchOS 7.0, *) {
self = .AppleWatchSeries6_40mm
}

case "Watch6,2", "Watch6,4":
if #available(watchOS 7.0, *) {
self = .AppleWatchSeries6_44mm
}

default: break

}
Expand All @@ -130,6 +162,10 @@ public enum Watches {
case .AppleWatchSeries4_44mm: return "Apple Watch Series 4"
case .AppleWatchSeries5_40mm: return "Apple Watch Series 5"
case .AppleWatchSeries5_44mm: return "Apple Watch Series 5"
case .AppleWatchSE_40mm: return "Apple Watch SE"
case .AppleWatchSE_44mm: return "Apple Watch SE"
case .AppleWatchSeries6_40mm: return "Apple Watch Series 6"
case .AppleWatchSeries6_44mm: return "Apple Watch Series 6"

default: return nil
}
Expand Down
2 changes: 1 addition & 1 deletion Orchard.podspec
@@ -1,7 +1,7 @@
Pod::Spec.new do |spec|

spec.name = "Orchard"
spec.version = "1.6.1"
spec.version = "1.7.0"
spec.summary = "Device identification for iOS, watchOS, and tvOS."

spec.description = <<-DESC
Expand Down
4 changes: 2 additions & 2 deletions Orchard.xcodeproj/project.pbxproj
Expand Up @@ -574,7 +574,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MARKETING_VERSION = 1.6.1;
MARKETING_VERSION = 1.7.0;
ONLY_ACTIVE_ARCH = YES;
RUN_CLANG_STATIC_ANALYZER = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos appletvsimulator appletvos";
Expand Down Expand Up @@ -615,7 +615,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MARKETING_VERSION = 1.6.1;
MARKETING_VERSION = 1.7.0;
RUN_CLANG_STATIC_ANALYZER = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos appletvsimulator appletvos";
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down

0 comments on commit fe91a28

Please sign in to comment.