Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wireless charger #209

Merged
merged 10 commits into from
Oct 5, 2019
23 changes: 17 additions & 6 deletions Source/Device.generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ public enum Device {
///
/// ![Image](https://support.apple.com/library/APPLE/APPLECARE_ALLGEOS/SP787/ipad-air-2019.jpg)
case iPadAir3
/// Device is an [iPad (7th generation)](https://support.apple.com/kb/SP807)
///
/// ![Image](https://support.apple.com/library/APPLE/APPLECARE_ALLGEOS/SP807/sp807-ipad-7th-gen_2x.png)
case iPad7
/// Device is an [iPad Mini](https://support.apple.com/kb/SP661)
///
/// ![Image](https://support.apple.com/library/APPLE/APPLECARE_ALLGEOS/SP661/sp661_ipad_mini_color.jpg)
Expand Down Expand Up @@ -352,6 +356,7 @@ public enum Device {
case "iPad6,11", "iPad6,12": return iPad5
case "iPad7,5", "iPad7,6": return iPad6
case "iPad11,3", "iPad11,4": return iPadAir3
case "iPad7,11", "iPad7,12": return iPad7
case "iPad2,5", "iPad2,6", "iPad2,7": return iPadMini
case "iPad4,4", "iPad4,5", "iPad4,6": return iPadMini2
case "iPad4,7", "iPad4,8", "iPad4,9": return iPadMini3
Expand Down Expand Up @@ -446,6 +451,7 @@ public enum Device {
case .iPad5: return 9.7
case .iPad6: return 9.7
case .iPadAir3: return 10.5
case .iPad7: return 10.2
case .iPadMini: return 7.9
case .iPadMini2: return 7.9
case .iPadMini3: return 7.9
Expand Down Expand Up @@ -518,6 +524,7 @@ public enum Device {
case .iPad5: return (width: 3, height: 4)
case .iPad6: return (width: 3, height: 4)
case .iPadAir3: return (width: 3, height: 4)
case .iPad7: return (width: 3, height: 4)
case .iPadMini: return (width: 3, height: 4)
case .iPadMini2: return (width: 3, height: 4)
case .iPadMini3: return (width: 3, height: 4)
Expand Down Expand Up @@ -568,7 +575,7 @@ public enum Device {

/// All iPads
public static var allPads: [Device] {
return [.iPad2, .iPad3, .iPad4, .iPadAir, .iPadAir2, .iPad5, .iPad6, .iPadAir3, .iPadMini, .iPadMini2, .iPadMini3, .iPadMini4, .iPadMini5, .iPadPro9Inch, .iPadPro12Inch, .iPadPro12Inch2, .iPadPro10Inch, .iPadPro11Inch, .iPadPro12Inch3]
return [.iPad2, .iPad3, .iPad4, .iPadAir, .iPadAir2, .iPad5, .iPad6, .iPadAir3, .iPad7, .iPadMini, .iPadMini2, .iPadMini3, .iPadMini4, .iPadMini5, .iPadPro9Inch, .iPadPro12Inch, .iPadPro12Inch2, .iPadPro10Inch, .iPadPro11Inch, .iPadPro12Inch3]
}

/// All X-Series Devices
Expand Down Expand Up @@ -669,7 +676,7 @@ public enum Device {

/// All Touch ID Capable Devices
public static var allTouchIDCapableDevices: [Device] {
return [.iPhone5s, .iPhone6, .iPhone6Plus, .iPhone6s, .iPhone6sPlus, .iPhone7, .iPhone7Plus, .iPhoneSE, .iPhone8, .iPhone8Plus, .iPadAir2, .iPad5, .iPad6, .iPadAir3, .iPadMini3, .iPadMini4, .iPadMini5, .iPadPro9Inch, .iPadPro12Inch, .iPadPro12Inch2, .iPadPro10Inch]
return [.iPhone5s, .iPhone6, .iPhone6Plus, .iPhone6s, .iPhone6sPlus, .iPhone7, .iPhone7Plus, .iPhoneSE, .iPhone8, .iPhone8Plus, .iPadAir2, .iPad5, .iPad6, .iPadAir3, .iPad7, .iPadMini3, .iPadMini4, .iPadMini5, .iPadPro9Inch, .iPadPro12Inch, .iPadPro12Inch2, .iPadPro10Inch]
}

/// All Face ID Capable Devices
Expand Down Expand Up @@ -721,7 +728,7 @@ public enum Device {
public var has3dTouchSupport: Bool {
return isOneOf(Device.allDevicesWith3dTouchSupport)
}

gianpispi marked this conversation as resolved.
Show resolved Hide resolved
/// All devices that support wireless charging.
public static var allDevicesWithWirelessChargingSupport: [Device] {
return [.iPhone8, .iPhone8Plus, .iPhoneX, .iPhoneXS, .iPhoneXSMax, .iPhoneXR, .iPhone11, .iPhone11Pro, .iPhone11ProMax]
Expand Down Expand Up @@ -903,6 +910,7 @@ public enum Device {
case .iPad5: return 264
case .iPad6: return 264
case .iPadAir3: return 264
case .iPad7: return 264
case .iPadMini: return 163
case .iPadMini2: return 326
case .iPadMini3: return 326
Expand Down Expand Up @@ -1002,6 +1010,7 @@ extension Device: CustomStringConvertible {
case .iPad5: return "iPad (5th generation)"
case .iPad6: return "iPad (6th generation)"
case .iPadAir3: return "iPad Air (3rd generation)"
case .iPad7: return "iPad (7th generation)"
case .iPadMini: return "iPad Mini"
case .iPadMini2: return "iPad Mini 2"
case .iPadMini3: return "iPad Mini 3"
Expand Down Expand Up @@ -1296,14 +1305,15 @@ extension Device {

/// All Apple Pencil Capable Devices
public static var allApplePencilCapableDevices: [Device] {
return [.iPad6, .iPadAir3, .iPadMini5, .iPadPro9Inch, .iPadPro12Inch, .iPadPro12Inch2, .iPadPro10Inch, .iPadPro11Inch, .iPadPro12Inch3]
return [.iPad6, .iPadAir3, .iPad7, .iPadMini5, .iPadPro9Inch, .iPadPro12Inch, .iPadPro12Inch2, .iPadPro10Inch, .iPadPro11Inch, .iPadPro12Inch3]
}

/// Returns supported version of the Apple Pencil
public var applePencilSupport: ApplePencilSupport {
switch self {
case .iPad6: return .firstGeneration
case .iPadAir3: return .firstGeneration
case .iPad7: return .firstGeneration
case .iPadMini5: return .firstGeneration
case .iPadPro9Inch: return .firstGeneration
case .iPadPro12Inch: return .firstGeneration
Expand Down Expand Up @@ -1354,6 +1364,7 @@ extension Device {
case .iPad5: return [.normal]
case .iPad6: return [.normal]
case .iPadAir3: return [.normal]
case .iPad7: return [.normal]
case .iPadMini: return [.normal]
case .iPadMini2: return [.normal]
case .iPadMini3: return [.normal]
Expand All @@ -1379,12 +1390,12 @@ extension Device {

/// All devices that feature a camera
public static var allDevicesWithCamera: [Device] {
return [.iPodTouch5, .iPodTouch6, .iPodTouch7, .iPhone4, .iPhone4s, .iPhone5, .iPhone5c, .iPhone5s, .iPhone6, .iPhone6Plus, .iPhone6s, .iPhone6sPlus, .iPhone7, .iPhone7Plus, .iPhoneSE, .iPhone8, .iPhone8Plus, .iPhoneX, .iPhoneXS, .iPhoneXSMax, .iPhoneXR, .iPhone11, .iPhone11Pro, .iPhone11ProMax, .iPad2, .iPad3, .iPad4, .iPadAir, .iPadAir2, .iPad5, .iPad6, .iPadAir3, .iPadMini, .iPadMini2, .iPadMini3, .iPadMini4, .iPadMini5, .iPadPro9Inch, .iPadPro12Inch, .iPadPro12Inch2, .iPadPro10Inch, .iPadPro11Inch, .iPadPro12Inch3]
return [.iPodTouch5, .iPodTouch6, .iPodTouch7, .iPhone4, .iPhone4s, .iPhone5, .iPhone5c, .iPhone5s, .iPhone6, .iPhone6Plus, .iPhone6s, .iPhone6sPlus, .iPhone7, .iPhone7Plus, .iPhoneSE, .iPhone8, .iPhone8Plus, .iPhoneX, .iPhoneXS, .iPhoneXSMax, .iPhoneXR, .iPhone11, .iPhone11Pro, .iPhone11ProMax, .iPad2, .iPad3, .iPad4, .iPadAir, .iPadAir2, .iPad5, .iPad6, .iPadAir3, .iPad7, .iPadMini, .iPadMini2, .iPadMini3, .iPadMini4, .iPadMini5, .iPadPro9Inch, .iPadPro12Inch, .iPadPro12Inch2, .iPadPro10Inch, .iPadPro11Inch, .iPadPro12Inch3]
}

/// All devices that feature a normal camera
public static var allDevicesWithNormalCamera: [Device] {
return [.iPodTouch5, .iPodTouch6, .iPodTouch7, .iPhone4, .iPhone4s, .iPhone5, .iPhone5c, .iPhone5s, .iPhone6, .iPhone6Plus, .iPhone6s, .iPhone6sPlus, .iPhone7, .iPhone7Plus, .iPhoneSE, .iPhone8, .iPhone8Plus, .iPhoneX, .iPhoneXS, .iPhoneXSMax, .iPhoneXR, .iPhone11, .iPhone11Pro, .iPhone11ProMax, .iPad2, .iPad3, .iPad4, .iPadAir, .iPadAir2, .iPad5, .iPad6, .iPadAir3, .iPadMini, .iPadMini2, .iPadMini3, .iPadMini4, .iPadMini5, .iPadPro9Inch, .iPadPro12Inch, .iPadPro12Inch2, .iPadPro10Inch, .iPadPro11Inch, .iPadPro12Inch3]
return [.iPodTouch5, .iPodTouch6, .iPodTouch7, .iPhone4, .iPhone4s, .iPhone5, .iPhone5c, .iPhone5s, .iPhone6, .iPhone6Plus, .iPhone6s, .iPhone6sPlus, .iPhone7, .iPhone7Plus, .iPhoneSE, .iPhone8, .iPhone8Plus, .iPhoneX, .iPhoneXS, .iPhoneXSMax, .iPhoneXR, .iPhone11, .iPhone11Pro, .iPhone11ProMax, .iPad2, .iPad3, .iPad4, .iPadAir, .iPadAir2, .iPad5, .iPad6, .iPadAir3, .iPad7, .iPadMini, .iPadMini2, .iPadMini3, .iPadMini4, .iPadMini5, .iPadPro9Inch, .iPadPro12Inch, .iPadPro12Inch2, .iPadPro10Inch, .iPadPro11Inch, .iPadPro12Inch3]
}

/// All devices that feature a telephoto camera
Expand Down
Loading