Skip to content

Commit 53719b5

Browse files
Sebastian DobrincuSebastian Dobrincu
Sebastian Dobrincu
authored and
Sebastian Dobrincu
committed
Added new iPhones ️⃣s ⚡️
1 parent 0b47a64 commit 53719b5

File tree

8 files changed

+82
-64
lines changed

8 files changed

+82
-64
lines changed

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,28 +37,28 @@ SDVersion supports iOS, watchOS, tvOS, and macOS. Browse through the implementat
3737
```objective-c
3838

3939
// Check for device model
40-
if ([SDVersion deviceVersion] == iPhone6S)
41-
NSLog(@"You got the iPhone 6S. Sweet 🍭!");
42-
else if ([SDVersion deviceVersion] == iPhone6Plus)
43-
NSLog(@"iPhone 6 Plus? Bigger is better!");
40+
if ([SDVersion deviceVersion] == iPhone7)
41+
NSLog(@"You got the iPhone 7. Sweet 🍭!");
42+
else if ([SDVersion deviceVersion] == iPhone6SPlus)
43+
NSLog(@"iPhone 6S Plus? Bigger is better!");
4444
else if ([SDVersion deviceVersion] == iPadPro)
4545
NSLog(@"You own an iPad Pro 🌀!");
4646

4747
// Check for device screen size
48-
if ([SDVersion deviceSize] == Screen4inch)
49-
NSLog(@"Your screen is 4 inches");
48+
if ([SDVersion deviceSize] == Screen4Dot7inch)
49+
NSLog(@"Your screen is 4.7 inches");
5050

5151
// Check if screen is in zoom mode
5252
if ([SDVersion isZoomed])
5353
NSLog(@"Your device is in Zoom Mode 🔎");
5454

5555
// Get device name
5656
NSLog(@"%@", DeviceVersionNames[[SDVersion deviceVersion]]);
57-
/* e.g: Outputs 'iPhone 6S Plus' */
57+
/* e.g: Outputs 'iPhone 7 Plus' */
5858

5959
// Check for iOS Version
60-
if (iOSVersionGreaterThanOrEqual(@"9"))
61-
NSLog(@"You are running iOS 9 or above!");
60+
if (iOSVersionGreaterThanOrEqual(@"10"))
61+
NSLog(@"You are running iOS 10 or above!");
6262

6363
```
6464

@@ -109,6 +109,8 @@ CocoaPods is a dependency manager for Objective-C, which automates and simplifie
109109
iPhone6S
110110
iPhone6SPlus
111111
iPhoneSE
112+
iPhone7
113+
iPhone7Plus
112114

113115
iPad1
114116
iPad2

SDVersion-Demo/SDVersion.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@
10361036
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
10371037
IBSC_WARNINGS = YES;
10381038
INFOPLIST_FILE = SDiOSVersion/Info.plist;
1039-
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
1039+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
10401040
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
10411041
PRODUCT_BUNDLE_IDENTIFIER = "com.dobrincusebastian.$(PRODUCT_NAME:rfc1034identifier)";
10421042
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -1052,7 +1052,7 @@
10521052
CODE_SIGN_IDENTITY = "";
10531053
IBSC_WARNINGS = YES;
10541054
INFOPLIST_FILE = SDiOSVersion/Info.plist;
1055-
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
1055+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
10561056
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
10571057
PRODUCT_BUNDLE_IDENTIFIER = "com.dobrincusebastian.$(PRODUCT_NAME:rfc1034identifier)";
10581058
PRODUCT_NAME = "$(TARGET_NAME)";

SDVersion-Demo/SDVersion/SDiOSVersion.h

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,29 @@ typedef NS_ENUM(NSInteger, DeviceVersion){
2020
iPhone6Plus = 9,
2121
iPhone6S = 10,
2222
iPhone6SPlus = 11,
23-
iPhoneSE = 12,
23+
iPhone7 = 12,
24+
iPhone7Plus = 13,
25+
iPhoneSE = 14,
2426

25-
iPad1 = 13,
26-
iPad2 = 14,
27-
iPadMini = 15,
28-
iPad3 = 16,
29-
iPad4 = 17,
30-
iPadAir = 18,
31-
iPadMini2 = 19,
32-
iPadAir2 = 20,
33-
iPadMini3 = 21,
34-
iPadMini4 = 22,
35-
iPadPro12Dot9Inch = 23,
36-
iPadPro9Dot7Inch = 24,
27+
iPad1 = 15,
28+
iPad2 = 16,
29+
iPadMini = 17,
30+
iPad3 = 18,
31+
iPad4 = 19,
32+
iPadAir = 20,
33+
iPadMini2 = 21,
34+
iPadAir2 = 22,
35+
iPadMini3 = 23,
36+
iPadMini4 = 24,
37+
iPadPro12Dot9Inch = 25,
38+
iPadPro9Dot7Inch = 26,
3739

38-
iPodTouch1Gen = 25,
39-
iPodTouch2Gen = 26,
40-
iPodTouch3Gen = 27,
41-
iPodTouch4Gen = 28,
42-
iPodTouch5Gen = 29,
43-
iPodTouch6Gen = 30,
40+
iPodTouch1Gen = 27,
41+
iPodTouch2Gen = 28,
42+
iPodTouch3Gen = 29,
43+
iPodTouch4Gen = 30,
44+
iPodTouch5Gen = 31,
45+
iPodTouch6Gen = 32,
4446

4547
Simulator = 0
4648
};
@@ -55,8 +57,10 @@ static NSString *DeviceVersionNames[] = {
5557
[iPhone6Plus] = @"iPhone 6 Plus",
5658
[iPhone6S] = @"iPhone 6S",
5759
[iPhone6SPlus] = @"iPhone 6S Plus",
60+
[iPhone7] = @"iPhone 7",
61+
[iPhone7Plus] = @"iPhone 7 Plus",
5862
[iPhoneSE] = @"iPhone SE",
59-
63+
6064
[iPad1] = @"iPad 1",
6165
[iPad2] = @"iPad 2",
6266
[iPadMini] = @"iPad Mini",
@@ -69,14 +73,14 @@ static NSString *DeviceVersionNames[] = {
6973
[iPadMini4] = @"iPad Mini 4",
7074
[iPadPro9Dot7Inch] = @"iPad Pro",
7175
[iPadPro12Dot9Inch] = @"iPad Pro",
72-
76+
7377
[iPodTouch1Gen] = @"iPod Touch 1st Gen",
7478
[iPodTouch2Gen] = @"iPod Touch 2nd Gen",
7579
[iPodTouch3Gen] = @"iPod Touch 3rd Gen",
7680
[iPodTouch4Gen] = @"iPod Touch 4th Gen",
7781
[iPodTouch5Gen] = @"iPod Touch 5th Gen",
7882
[iPodTouch6Gen] = @"iPod Touch 6th Gen",
79-
83+
8084
[Simulator] = @"Simulator"
8185
};
8286

SDVersion-Demo/SDVersion/SDiOSVersion.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ + (NSDictionary*)deviceNamesByCode
3535
@"iPhone8,1" : @(iPhone6S),
3636
@"iPhone8,2" : @(iPhone6SPlus),
3737
@"iPhone8,4" : @(iPhoneSE),
38+
@"iPhone9,1" : @(iPhone7),
39+
@"iPhone9,3" : @(iPhone7),
40+
@"iPhone9,2" : @(iPhone7Plus),
41+
@"iPhone9,4" : @(iPhone7Plus),
3842
@"i386" : @(Simulator),
3943
@"x86_64" : @(Simulator),
4044

SDVersion-Demo/SDiOSVersion/ViewController.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ - (void)viewDidLoad {
2020
self.iphoneSizeLabel.text = [self.iphoneSizeLabel.text stringByAppendingString:[NSString stringWithFormat:@"%@", DeviceSizeNames[[SDiOSVersion deviceSize]]]];
2121

2222
// Check for device model
23-
if ([SDiOSVersion deviceVersion] == iPhone6)
24-
NSLog(@"You got the iPhone 6. Nice!");
25-
else if ([SDiOSVersion deviceVersion] == iPhone5S)
26-
NSLog(@"You got the iPhone 5S. Good device!");
23+
if ([SDiOSVersion deviceVersion] == iPhone7)
24+
NSLog(@"You got the iPhone 7. Nice!");
25+
else if ([SDiOSVersion deviceVersion] == iPhone6SPlus)
26+
NSLog(@"You got the iPhone 6S Plus. Awesome device!");
2727
else if ([SDiOSVersion deviceVersion] == iPodTouch6Gen)
2828
NSLog(@"The latest iPod Touch. Cool! ❄️");
2929

@@ -42,10 +42,10 @@ - (void)viewDidLoad {
4242
}
4343

4444
//Check for iOS Version
45-
if (iOSVersionGreaterThanOrEqualTo(@"9"))
46-
NSLog(@"You are running iOS 9️⃣ or above!");
47-
else if (iOSVersionLessThanOrEqualTo(@"8.4"))
48-
NSLog(@"You're on iOS 8.4 or below! ⏳");
45+
if (iOSVersionGreaterThanOrEqualTo(@"10"))
46+
NSLog(@"You are running iOS 1️⃣0️⃣ or above!");
47+
else if (iOSVersionLessThanOrEqualTo(@"9.1"))
48+
NSLog(@"You're on iOS 9.1 or below! ⏳");
4949
}
5050

5151

SDVersion.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Pod::Spec.new do |s|
88
#
99

1010
s.name = "SDVersion"
11-
s.version = "3.5"
11+
s.version = "3.6"
1212
s.summary = "Objective-C library for detecting running device model and screen size."
1313
s.homepage = "https://github.com/sebyddd/SDVersion"
1414
s.screenshots = "https://dl.dropboxusercontent.com/s/bmfjwfe2ngnivwn/sdversion.png?dl=0"

SDVersion/SDiOSVersion/SDiOSVersion.h

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,29 @@ typedef NS_ENUM(NSInteger, DeviceVersion){
2020
iPhone6Plus = 9,
2121
iPhone6S = 10,
2222
iPhone6SPlus = 11,
23-
iPhoneSE = 12,
23+
iPhone7 = 12,
24+
iPhone7Plus = 13,
25+
iPhoneSE = 14,
2426

25-
iPad1 = 13,
26-
iPad2 = 14,
27-
iPadMini = 15,
28-
iPad3 = 16,
29-
iPad4 = 17,
30-
iPadAir = 18,
31-
iPadMini2 = 19,
32-
iPadAir2 = 20,
33-
iPadMini3 = 21,
34-
iPadMini4 = 22,
35-
iPadPro12Dot9Inch = 23,
36-
iPadPro9Dot7Inch = 24,
27+
iPad1 = 15,
28+
iPad2 = 16,
29+
iPadMini = 17,
30+
iPad3 = 18,
31+
iPad4 = 19,
32+
iPadAir = 20,
33+
iPadMini2 = 21,
34+
iPadAir2 = 22,
35+
iPadMini3 = 23,
36+
iPadMini4 = 24,
37+
iPadPro12Dot9Inch = 25,
38+
iPadPro9Dot7Inch = 26,
3739

38-
iPodTouch1Gen = 25,
39-
iPodTouch2Gen = 26,
40-
iPodTouch3Gen = 27,
41-
iPodTouch4Gen = 28,
42-
iPodTouch5Gen = 29,
43-
iPodTouch6Gen = 30,
40+
iPodTouch1Gen = 27,
41+
iPodTouch2Gen = 28,
42+
iPodTouch3Gen = 29,
43+
iPodTouch4Gen = 30,
44+
iPodTouch5Gen = 31,
45+
iPodTouch6Gen = 32,
4446

4547
Simulator = 0
4648
};
@@ -55,8 +57,10 @@ static NSString *DeviceVersionNames[] = {
5557
[iPhone6Plus] = @"iPhone 6 Plus",
5658
[iPhone6S] = @"iPhone 6S",
5759
[iPhone6SPlus] = @"iPhone 6S Plus",
60+
[iPhone7] = @"iPhone 7",
61+
[iPhone7Plus] = @"iPhone 7 Plus",
5862
[iPhoneSE] = @"iPhone SE",
59-
63+
6064
[iPad1] = @"iPad 1",
6165
[iPad2] = @"iPad 2",
6266
[iPadMini] = @"iPad Mini",
@@ -69,14 +73,14 @@ static NSString *DeviceVersionNames[] = {
6973
[iPadMini4] = @"iPad Mini 4",
7074
[iPadPro9Dot7Inch] = @"iPad Pro",
7175
[iPadPro12Dot9Inch] = @"iPad Pro",
72-
76+
7377
[iPodTouch1Gen] = @"iPod Touch 1st Gen",
7478
[iPodTouch2Gen] = @"iPod Touch 2nd Gen",
7579
[iPodTouch3Gen] = @"iPod Touch 3rd Gen",
7680
[iPodTouch4Gen] = @"iPod Touch 4th Gen",
7781
[iPodTouch5Gen] = @"iPod Touch 5th Gen",
7882
[iPodTouch6Gen] = @"iPod Touch 6th Gen",
79-
83+
8084
[Simulator] = @"Simulator"
8185
};
8286

SDVersion/SDiOSVersion/SDiOSVersion.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ + (NSDictionary*)deviceNamesByCode
3535
@"iPhone8,1" : @(iPhone6S),
3636
@"iPhone8,2" : @(iPhone6SPlus),
3737
@"iPhone8,4" : @(iPhoneSE),
38+
@"iPhone9,1" : @(iPhone7),
39+
@"iPhone9,3" : @(iPhone7),
40+
@"iPhone9,2" : @(iPhone7Plus),
41+
@"iPhone9,4" : @(iPhone7Plus),
3842
@"i386" : @(Simulator),
3943
@"x86_64" : @(Simulator),
4044

0 commit comments

Comments
 (0)