Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ CocoaPods is a dependency manager for Objective-C, which automates and simplifie
iPhoneSE
iPhone7
iPhone7Plus
iPhone8
iPhone8Plus
iPhoneX
iPhoneXS
iPhoneXR
iPhoneXSMax

iPad1
iPad2
Expand Down Expand Up @@ -168,6 +174,10 @@ CocoaPods is a dependency manager for Objective-C, which automates and simplifie
Screen4inch
Screen4Dot7inch
Screen5Dot5inch
Screen5Dot8inch
Screen6Dot1inch
Screen6Dot5inch

### Available iOS Version Finder methods
```objective-c
+ (BOOL)versionEqualTo:(NSString *)version;
Expand Down Expand Up @@ -206,12 +216,18 @@ Or in Swift:
Apple Watch 42mm Series 1
Apple Watch 38mm Series 2
Apple Watch 42mm Series 2
Apple Watch 38mm Series 3
Apple Watch 42mm Series 3
Apple Watch 40mm Series 4
Apple Watch 44mm Series 4

Simulator

### Targetable screen sizes
Screen38mm
Screen40mm
Screen42mm
Screen44mm

### Available watchOS Version Finder methods
```objective-c
Expand Down
18 changes: 12 additions & 6 deletions SDVersion-Demo/SDVersion.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@
9AA6624019BFABFC0055042F /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0910;
LastUpgradeCheck = 1000;
ORGANIZATIONNAME = "Sebastian Dobrincu";
TargetAttributes = {
1FC73CFF1D244B87005F81DA = {
Expand All @@ -564,7 +564,7 @@
};
9AA6626019BFABFC0055042F = {
CreatedOnToolsVersion = 6.0;
LastSwiftMigration = 0820;
LastSwiftMigration = 1000;
TestTargetID = 9AA6624719BFABFC0055042F;
};
E2D975171B8265DF00675936 = {
Expand Down Expand Up @@ -974,12 +974,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -1027,12 +1029,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -1070,7 +1074,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
IBSC_WARNINGS = YES;
INFOPLIST_FILE = SDiOSVersion/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.dobrincusebastian.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -1086,7 +1090,7 @@
CODE_SIGN_IDENTITY = "";
IBSC_WARNINGS = YES;
INFOPLIST_FILE = SDiOSVersion/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.dobrincusebastian.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -1114,7 +1118,8 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "SDiOSVersionTests/SDiOSVersionTests-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SDiOSVersion.app/SDiOSVersion";
};
name = Debug;
Expand All @@ -1134,7 +1139,8 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.dobrincusebastian.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "SDiOSVersionTests/SDiOSVersionTests-Bridging-Header.h";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SDiOSVersion.app/SDiOSVersion";
};
name = Release;
Expand Down
6 changes: 5 additions & 1 deletion SDVersion-Demo/SDiOSVersion/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ @implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
[[UIApplication sharedApplication] setStatusBarHidden:YES];

#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000
[[UIApplication sharedApplication] setStatusBarHidden:YES];
#endif

return YES;
}

Expand Down
11 changes: 10 additions & 1 deletion SDVersion-Demo/SDiOSVersion/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

@implementation ViewController

- (BOOL)prefersStatusBarHidden {
return true;
}

- (void)viewDidLoad {
[super viewDidLoad];

Expand All @@ -36,6 +40,12 @@ - (void)viewDidLoad {
NSLog(@"Your screen size is 4.7 inches");
else if([SDVersion deviceSize] == Screen5Dot5inch)
NSLog(@"Your screen size is 5.5 inches");
else if([SDVersion deviceSize] == Screen5Dot8inch)
NSLog(@"Your screen size is 5.8 inches");
else if([SDVersion deviceSize] == Screen6Dot1inch)
NSLog(@"Your screen size is 6.1 inches");
else if([SDVersion deviceSize] == Screen6Dot5inch)
NSLog(@"Your screen size is 6.5 inches");

if ([SDVersion isZoomed]) {
NSLog(@"Your device is in Zoom Mode!");
Expand All @@ -48,5 +58,4 @@ - (void)viewDidLoad {
NSLog(@"You're on iOS 9.1 or below! ⏳");
}


@end
64 changes: 39 additions & 25 deletions SDVersion/SDiOSVersion/SDiOSVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
typedef NS_ENUM(NSInteger, DeviceVersion){
UnknownDevice = 0,
Simulator = 1,

iPhone4 = 3,
iPhone4S = 4,
iPhone5 = 5,
Expand All @@ -26,29 +26,41 @@ typedef NS_ENUM(NSInteger, DeviceVersion){
iPhone8Plus = 15,
iPhoneX = 16,
iPhoneSE = 17,

iPad1 = 18,
iPad2 = 19,
iPadMini = 20,
iPad3 = 21,
iPad4 = 22,
iPadAir = 23,
iPadMini2 = 24,
iPadAir2 = 25,
iPadMini3 = 26,
iPadMini4 = 27,
iPadPro12Dot9Inch = 28,
iPadPro9Dot7Inch = 29,
iPad5 = 30,
iPadPro12Dot9Inch2Gen = 31,
iPadPro10Dot5Inch = 32,

iPodTouch1Gen = 33,
iPodTouch2Gen = 34,
iPodTouch3Gen = 35,
iPodTouch4Gen = 36,
iPodTouch5Gen = 37,
iPodTouch6Gen = 38
iPhoneXS = 18,
iPhoneXR = 19,
iPhoneXSMax = 20,
iPhone11 = 20,
iPhone11Pro = 21,
iPhone11ProMax = 22,

iPad1 = 23,
iPad2 = 24,
iPadMini = 25,
iPad3 = 26,
iPad4 = 27,
iPadAir = 28,
iPadMini2 = 29,
iPadAir2 = 30,
iPadMini3 = 31,
iPadMini4 = 32,
iPadPro12Dot9Inch = 33,
iPadPro9Dot7Inch = 34,
iPad5 = 35,
iPadPro12Dot9Inch2Gen = 36,
iPadPro10Dot5Inch = 37,
iPad6 = 38,
iPad7 = 39,
iPadAir3 = 40,
iPadMini5 = 41,
iPadPro11Inch = 42,
iPadPro12Dot9Inch3Gen = 43,

iPodTouch1Gen = 44,
iPodTouch2Gen = 45,
iPodTouch3Gen = 46,
iPodTouch4Gen = 47,
iPodTouch5Gen = 48,
iPodTouch6Gen = 49
};

typedef NS_ENUM(NSInteger, DeviceSize){
Expand All @@ -57,7 +69,9 @@ typedef NS_ENUM(NSInteger, DeviceSize){
Screen4inch = 2,
Screen4Dot7inch = 3,
Screen5Dot5inch = 4,
Screen5Dot8inch = 5
Screen5Dot8inch = 5,
Screen6Dot1inch = 6,
Screen6Dot5inch = 7
};

@interface SDiOSVersion : NSObject
Expand Down
Loading