Skip to content

Commit

Permalink
Added iPhone 15 models
Browse files Browse the repository at this point in the history
  • Loading branch information
andrealufino committed Oct 6, 2023
1 parent 86f4a75 commit a13e5eb
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 22 deletions.
4 changes: 4 additions & 0 deletions Sources/Deviice/Identifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ public enum Identifier: String, CaseIterable {
case iPhone14_8 = "iPhone14,8"
case iPhone15_2 = "iPhone15,2"
case iPhone15_3 = "iPhone15,3"
case iPhone15_4 = "iPhone15,4"
case iPhone15_5 = "iPhone15,5"
case iPhone16_1 = "iPhone16,1"
case iPhone16_2 = "iPhone16,2"

// MARK: iPad
case iPad2_1 = "iPad2,1"
Expand Down
52 changes: 30 additions & 22 deletions Sources/Deviice/Mapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ public struct Mapper {
case .iPhone14_8: return .iPhone14Plus
case .iPhone15_2: return .iPhone14Pro
case .iPhone15_3: return .iPhone14ProMax
case .iPhone15_4: return .iPhone15
case .iPhone15_5: return .iPhone15Plus
case .iPhone16_1: return .iPhone15Pro
case .iPhone16_2: return .iPhone15ProMax

// MARK: iPads
case .iPad2_1, .iPad2_2, .iPad2_3, .iPad2_4: return .iPad2
Expand Down Expand Up @@ -151,7 +155,7 @@ public struct Mapper {
.unknown:

return .unknown
// MARK: 3.5
// MARK: 3.5
case
.iPodTouch1,
.iPodTouch2,
Expand All @@ -162,7 +166,7 @@ public struct Mapper {
.iPhone3GS:

return .screen3Dot5Inch
// MARK: 4
// MARK: 4
case
.iPodTouch5,
.iPodTouch6,
Expand All @@ -174,7 +178,7 @@ public struct Mapper {
.iPhone5S:

return .screen4Inch
// MARK: 4.7
// MARK: 4.7
case
.iPhone6,
.iPhone6S,
Expand All @@ -185,28 +189,28 @@ public struct Mapper {
.iPhoneSE3:

return .screen4Dot7Inch
// MARK: 5.5
// MARK: 5.5
case
.iPhone6Plus,
.iPhone6sPlus,
.iPhone7Plus,
.iPhone8Plus:

return .screen5Dot5Inch
// MARK: 5.8
// MARK: 5.8
case
.iPhoneX,
.iPhoneXS,
.iPhone11Pro:

return .screen5Dot8Inch
// MARK: 6.5
// MARK: 6.5
case
.iPhoneXsMax,
.iPhone11ProMax:

return .screen6Dot5Inch
// MARK: 6.1
// MARK: 6.1
case
.iPhoneXr,
.iPhone11,
Expand All @@ -215,24 +219,28 @@ public struct Mapper {
.iPhone12Pro,
.iPhone13Pro,
.iPhone14,
.iPhone14Pro:
.iPhone14Pro,
.iPhone15,
.iPhone15Pro:

return .screen6Dot1Inch
// MARK: 5.4
// MARK: 5.4
case
.iPhone12Mini,
.iPhone13Mini:

return .screen5Dot4Inch
// MARK: 6.7
// MARK: 6.7
case
.iPhone12ProMax,
.iPhone13ProMax,
.iPhone14Plus,
.iPhone14ProMax:
.iPhone14ProMax,
.iPhone15Plus,
.iPhone15ProMax:

return .screen6Dot7Inch
// MARK: 9.7
// MARK: 9.7
case
.iPad2,
.iPad3,
Expand All @@ -244,27 +252,27 @@ public struct Mapper {
.iPadPro:

return .screen9Dot7Inch
// MARK: 10.5
// MARK: 10.5
case
.iPadAir3,
.iPadPro2:

return .screen10Dot5Inch
// MARK: 10.9
// MARK: 10.9
case
.iPadAir4,
.iPadAir5,
.iPad10:

return .screen10Dot9Inch
// MARK: 10.2
// MARK: 10.2
case
.iPad7,
.iPad8,
.iPad9:

return .screen10Dot2Inch
// MARK: 7.9
// MARK: 7.9
case
.iPadMini,
.iPadMini2,
Expand All @@ -273,20 +281,20 @@ public struct Mapper {
.iPadMini5:

return .screen7Dot9Inch
// MARK: 8.3
// MARK: 8.3
case
.iPadMini6:

return .screen8Dot3Inch
// MARK: 11
// MARK: 11
case
.iPadPro11Inch1,
.iPadPro11Inch2,
.iPadPro11Inch3,
.iPadPro11Inch4:

return .screen11Inch
// MARK: 12.9
// MARK: 12.9
case
.iPadPro12Inch1,
.iPadPro12Inch2,
Expand All @@ -296,9 +304,9 @@ public struct Mapper {
.iPadPro12Inch6:

return .screen12Dot9Inch
// MARK: Simulator
// Thanks to SubParDev (https://github.com/SubParDev) for this idea.
// See https://github.com/andrealufino/Deviice/issues/17 for details.
// MARK: Simulator
// Thanks to SubParDev (https://github.com/SubParDev) for this idea.
// See https://github.com/andrealufino/Deviice/issues/17 for details.
case
.simulator(let actualModel):

Expand Down
8 changes: 8 additions & 0 deletions Sources/Deviice/Model.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ public enum Model {
case iPhone14Plus
case iPhone14Pro
case iPhone14ProMax
case iPhone15
case iPhone15Plus
case iPhone15Pro
case iPhone15ProMax

// MARK: iPad
case iPad2
Expand Down Expand Up @@ -160,6 +164,10 @@ public extension Model {
case .iPhone14Plus: return "iPhone 14 Plus"
case .iPhone14Pro: return "iPhone 14 Pro"
case .iPhone14ProMax: return "iPhone 14 Pro Max"
case .iPhone15: return "iPhone 15"
case .iPhone15Plus: return "iPhone 15 Plus"
case .iPhone15Pro: return "iPhone 15 Pro"
case .iPhone15ProMax: return "iPhone 15 Pro Max"

// MARK: iPad
case .iPad2: return "iPad 2"
Expand Down

0 comments on commit a13e5eb

Please sign in to comment.