diff --git a/Example/UIDevice-Utils.xcodeproj/project.pbxproj b/Example/UIDevice-Utils.xcodeproj/project.pbxproj
index 68d1f11..81eec9d 100644
--- a/Example/UIDevice-Utils.xcodeproj/project.pbxproj
+++ b/Example/UIDevice-Utils.xcodeproj/project.pbxproj
@@ -467,7 +467,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 7.1;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
@@ -500,7 +500,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 7.1;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
diff --git a/Example/UIDevice-Utils/Images.xcassets/AppIcon.appiconset/Contents.json b/Example/UIDevice-Utils/Images.xcassets/AppIcon.appiconset/Contents.json
index f697f61..eeea76c 100644
--- a/Example/UIDevice-Utils/Images.xcassets/AppIcon.appiconset/Contents.json
+++ b/Example/UIDevice-Utils/Images.xcassets/AppIcon.appiconset/Contents.json
@@ -5,16 +5,31 @@
"size" : "29x29",
"scale" : "2x"
},
+ {
+ "idiom" : "iphone",
+ "size" : "29x29",
+ "scale" : "3x"
+ },
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
+ {
+ "idiom" : "iphone",
+ "size" : "40x40",
+ "scale" : "3x"
+ },
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
+ {
+ "idiom" : "iphone",
+ "size" : "60x60",
+ "scale" : "3x"
+ },
{
"idiom" : "ipad",
"size" : "29x29",
@@ -44,10 +59,15 @@
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "83.5x83.5",
+ "scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
-}
+}
\ No newline at end of file
diff --git a/Example/UIDevice-Utils/Images.xcassets/Contents.json b/Example/UIDevice-Utils/Images.xcassets/Contents.json
new file mode 100644
index 0000000..da4a164
--- /dev/null
+++ b/Example/UIDevice-Utils/Images.xcassets/Contents.json
@@ -0,0 +1,6 @@
+{
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
\ No newline at end of file
diff --git a/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Contents.json b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Contents.json
index 4458b40..0c793eb 100644
--- a/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Contents.json
+++ b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Contents.json
@@ -1,23 +1,53 @@
{
"images" : [
+ {
+ "extent" : "full-screen",
+ "idiom" : "iphone",
+ "subtype" : "736h",
+ "filename" : "Default-Portrait-736h@3x.png",
+ "minimum-system-version" : "8.0",
+ "orientation" : "portrait",
+ "scale" : "3x"
+ },
+ {
+ "extent" : "full-screen",
+ "idiom" : "iphone",
+ "subtype" : "736h",
+ "filename" : "Default-Landscape-736h@3x.png",
+ "minimum-system-version" : "8.0",
+ "orientation" : "landscape",
+ "scale" : "3x"
+ },
+ {
+ "extent" : "full-screen",
+ "idiom" : "iphone",
+ "subtype" : "667h",
+ "filename" : "Default-667h@2x.png",
+ "minimum-system-version" : "8.0",
+ "orientation" : "portrait",
+ "scale" : "2x"
+ },
{
"orientation" : "portrait",
"idiom" : "iphone",
+ "filename" : "Default@2x.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
- "orientation" : "portrait",
+ "extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "retina4",
- "extent" : "full-screen",
+ "filename" : "Default-568h@2x.png",
"minimum-system-version" : "7.0",
+ "orientation" : "portrait",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
+ "filename" : "Default~ipad~nostatusbar.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
@@ -25,6 +55,7 @@
{
"orientation" : "landscape",
"idiom" : "ipad",
+ "filename" : "Default~ipad~landscape~nostatusbar.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
@@ -32,6 +63,7 @@
{
"orientation" : "portrait",
"idiom" : "ipad",
+ "filename" : "Default~ipad~nostatusbar@2x.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
@@ -39,13 +71,92 @@
{
"orientation" : "landscape",
"idiom" : "ipad",
+ "filename" : "Default~ipad~landscape~nostatusbar@2x.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
+ },
+ {
+ "orientation" : "portrait",
+ "idiom" : "iphone",
+ "filename" : "Default.png",
+ "extent" : "full-screen",
+ "scale" : "1x"
+ },
+ {
+ "orientation" : "portrait",
+ "idiom" : "iphone",
+ "filename" : "Default@2x.png",
+ "extent" : "full-screen",
+ "scale" : "2x"
+ },
+ {
+ "orientation" : "portrait",
+ "idiom" : "iphone",
+ "filename" : "Default-568h@2x.png",
+ "extent" : "full-screen",
+ "subtype" : "retina4",
+ "scale" : "2x"
+ },
+ {
+ "orientation" : "portrait",
+ "idiom" : "ipad",
+ "filename" : "Default~ipad.png",
+ "extent" : "to-status-bar",
+ "scale" : "1x"
+ },
+ {
+ "orientation" : "portrait",
+ "idiom" : "ipad",
+ "filename" : "Default~ipad~nostatusbar.png",
+ "extent" : "full-screen",
+ "scale" : "1x"
+ },
+ {
+ "orientation" : "landscape",
+ "idiom" : "ipad",
+ "filename" : "Default~ipad~landscape.png",
+ "extent" : "to-status-bar",
+ "scale" : "1x"
+ },
+ {
+ "orientation" : "landscape",
+ "idiom" : "ipad",
+ "filename" : "Default~ipad~landscape~nostatusbar.png",
+ "extent" : "full-screen",
+ "scale" : "1x"
+ },
+ {
+ "orientation" : "portrait",
+ "idiom" : "ipad",
+ "filename" : "Default~ipad@2x.png",
+ "extent" : "to-status-bar",
+ "scale" : "2x"
+ },
+ {
+ "orientation" : "portrait",
+ "idiom" : "ipad",
+ "filename" : "Default~ipad~nostatusbar@2x.png",
+ "extent" : "full-screen",
+ "scale" : "2x"
+ },
+ {
+ "orientation" : "landscape",
+ "idiom" : "ipad",
+ "filename" : "Default~ipad~landscape@2x.png",
+ "extent" : "to-status-bar",
+ "scale" : "2x"
+ },
+ {
+ "orientation" : "landscape",
+ "idiom" : "ipad",
+ "filename" : "Default~ipad~landscape~nostatusbar@2x.png",
+ "extent" : "full-screen",
+ "scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
-}
+}
\ No newline at end of file
diff --git a/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png
new file mode 100644
index 0000000..52555a8
Binary files /dev/null and b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png differ
diff --git a/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default-667h@2x.png b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default-667h@2x.png
new file mode 100644
index 0000000..499a143
Binary files /dev/null and b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default-667h@2x.png differ
diff --git a/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h@3x.png b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h@3x.png
new file mode 100644
index 0000000..2d727e8
Binary files /dev/null and b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h@3x.png differ
diff --git a/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default-Portrait-736h@3x.png b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default-Portrait-736h@3x.png
new file mode 100644
index 0000000..5453d81
Binary files /dev/null and b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default-Portrait-736h@3x.png differ
diff --git a/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default.png b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default.png
new file mode 100644
index 0000000..43dedf5
Binary files /dev/null and b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default.png differ
diff --git a/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default@2x.png b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default@2x.png
new file mode 100644
index 0000000..3ffae63
Binary files /dev/null and b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default@2x.png differ
diff --git a/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default~ipad.png b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default~ipad.png
new file mode 100644
index 0000000..d8dfb22
Binary files /dev/null and b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default~ipad.png differ
diff --git a/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default~ipad@2x.png b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default~ipad@2x.png
new file mode 100644
index 0000000..d091503
Binary files /dev/null and b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default~ipad@2x.png differ
diff --git a/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default~ipad~landscape.png b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default~ipad~landscape.png
new file mode 100644
index 0000000..942487c
Binary files /dev/null and b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default~ipad~landscape.png differ
diff --git a/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default~ipad~landscape@2x.png b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default~ipad~landscape@2x.png
new file mode 100644
index 0000000..9024a89
Binary files /dev/null and b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default~ipad~landscape@2x.png differ
diff --git a/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default~ipad~landscape~nostatusbar.png b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default~ipad~landscape~nostatusbar.png
new file mode 100644
index 0000000..5bfb356
Binary files /dev/null and b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default~ipad~landscape~nostatusbar.png differ
diff --git a/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default~ipad~landscape~nostatusbar@2x.png b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default~ipad~landscape~nostatusbar@2x.png
new file mode 100644
index 0000000..342667d
Binary files /dev/null and b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default~ipad~landscape~nostatusbar@2x.png differ
diff --git a/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default~ipad~nostatusbar.png b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default~ipad~nostatusbar.png
new file mode 100644
index 0000000..4401e6a
Binary files /dev/null and b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default~ipad~nostatusbar.png differ
diff --git a/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default~ipad~nostatusbar@2x.png b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default~ipad~nostatusbar@2x.png
new file mode 100644
index 0000000..f772331
Binary files /dev/null and b/Example/UIDevice-Utils/Images.xcassets/LaunchImage.launchimage/Default~ipad~nostatusbar@2x.png differ
diff --git a/Example/UIDevice-Utils/UIDevice-Utils-Info.plist b/Example/UIDevice-Utils/UIDevice-Utils-Info.plist
index 6d3dcbd..c136cc7 100644
--- a/Example/UIDevice-Utils/UIDevice-Utils-Info.plist
+++ b/Example/UIDevice-Utils/UIDevice-Utils-Info.plist
@@ -30,6 +30,8 @@
armv7
+ UIRequiresFullScreen
+
UISupportedInterfaceOrientations
UIInterfaceOrientationPortrait
diff --git a/Pod/Classes/UIDevice-Hardware.h b/Pod/Classes/UIDevice-Hardware.h
index 763199c..1795609 100755
--- a/Pod/Classes/UIDevice-Hardware.h
+++ b/Pod/Classes/UIDevice-Hardware.h
@@ -73,6 +73,13 @@ typedef NS_ENUM(NSUInteger, UIDeviceModelInches) {
UIDeviceModelInches79,
UIDeviceModelInches97,
UIDeviceModelInches129,
+ UIDeviceSimulatorModelInches35 = UIDeviceModelInches35,
+ UIDeviceSimulatorModelInches4 = UIDeviceModelInches4,
+ UIDeviceSimulatorModelInches47 = UIDeviceModelInches47,
+ UIDeviceSimulatorModelInches55 = UIDeviceModelInches55,
+ UIDeviceSimulatorModelInches79 = UIDeviceModelInches79,
+ UIDeviceSimulatorModelInches97 = UIDeviceModelInches97,
+ UIDeviceSimulatorModelInches129 = UIDeviceModelInches129,
UIDeviceModelInchesUnKnown
};
diff --git a/Pod/Classes/UIDevice-Hardware.m b/Pod/Classes/UIDevice-Hardware.m
index d473f02..eb05862 100755
--- a/Pod/Classes/UIDevice-Hardware.m
+++ b/Pod/Classes/UIDevice-Hardware.m
@@ -171,6 +171,8 @@
if ([modelIdentifier isEqualToString:@"iPad4,2"]) return UIDeviceGenerationModeliPadAir;
if ([modelIdentifier isEqualToString:@"iPad5,3"]) return UIDeviceGenerationModeliPadAir2;
if ([modelIdentifier isEqualToString:@"iPad5,4"]) return UIDeviceGenerationModeliPadAir2;
+ if ([modelIdentifier isEqualToString:@"iPad6,7"]) return UIDeviceGenerationModeliPadPro;
+ if ([modelIdentifier isEqualToString:@"iPad6,8"]) return UIDeviceGenerationModeliPadPro;
// iPad Mini http://theiphonewiki.com/wiki/IPad_mini
@@ -203,8 +205,14 @@
if ([modelIdentifier hasSuffix:@"86"] || [modelIdentifier isEqual:@"x86_64"])
{
- BOOL smallerScreen = ([[UIScreen mainScreen] bounds].size.width < 768.0);
- return (smallerScreen ? UIDeviceGenerationModeliPhoneSimulator : UIDeviceGenerationModeliPadSimulator);
+ BOOL iPhoneScreen = ([[UIScreen mainScreen] bounds].size.width < 768.0);
+ BOOL iPadScreen = !iPhoneScreen;
+ if (iPadScreen) {
+ return UIDeviceGenerationModeliPadSimulator;
+ }
+ else {
+ return UIDeviceGenerationModeliPhoneSimulator;
+ }
}
return UIDeviceGenerationModelUnknown;
}
@@ -250,6 +258,9 @@
if ([modelIdentifier isEqualToString:@"iPad5,3"]) return @"iPad Air 2 (Wi-Fi)";
if ([modelIdentifier isEqualToString:@"iPad5,4"]) return @"iPad Air 2 (Cellular)";
+ if ([modelIdentifier isEqualToString:@"iPad6,7"]) return @"iPad Pro (Wi-Fi)";
+ if ([modelIdentifier isEqualToString:@"iPad6,8"]) return @"iPad Pro (Cellular)";
+
// iPad Mini http://theiphonewiki.com/wiki/IPad_mini
if ([modelIdentifier isEqualToString:@"iPad2,5"]) return @"iPad mini 1G (Wi-Fi)";
@@ -320,23 +331,62 @@
case UIDeviceGenerationModeliPad4:
case UIDeviceGenerationModeliPadAir:
case UIDeviceGenerationModeliPadAir2:{
-
return UIDeviceModelInches97;
}
break;
case UIDeviceGenerationModeliPadMini1:
case UIDeviceGenerationModeliPadMini2:
case UIDeviceGenerationModeliPadMini3:
- case UIDeviceGenerationModeliPadMini4:
- {
+ case UIDeviceGenerationModeliPadMini4:{
return UIDeviceModelInches79;
}
break;
case UIDeviceGenerationModeliPadPro:{
return UIDeviceModelInches129;
- }
- default:
break;
+ }
+ case UIDeviceGenerationModeliPadSimulator:
+ case UIDeviceGenerationModeliPhoneSimulator:{
+ CGRect screenRect = [[UIScreen mainScreen] bounds];
+ NSInteger screenHeight = ((NSInteger)screenRect.size.height > (NSInteger)screenRect.size.width) ? (NSInteger)screenRect.size.height : (NSInteger)screenRect.size.width;
+
+
+ switch (screenHeight) {
+ case 480:{
+ return UIDeviceSimulatorModelInches35;
+ }
+ break;
+ case 568:{
+ return UIDeviceSimulatorModelInches4;
+ break;
+ }
+ case 667:{
+ return UIDeviceSimulatorModelInches47;
+ break;
+ }
+ case 736:{
+ return UIDeviceSimulatorModelInches55;
+ break;
+ }
+ case 1024:{
+ return UIDeviceModelInches97;
+ break;
+ }
+ case 1366:{
+ return UIDeviceSimulatorModelInches129;
+ break;
+ }
+ default:{
+ return UIDeviceModelInchesUnKnown;
+ break;
+ }
+ }
+ break;
+ }
+ default: {
+ return UIDeviceModelInchesUnKnown;
+ break;
+ }
}
return UIDeviceModelInchesUnKnown;
}
diff --git a/README.md b/README.md
index 71a2fd2..9ee64f9 100644
--- a/README.md
+++ b/README.md
@@ -17,10 +17,6 @@ UIDevice-Utils is available through [CocoaPods](http://cocoapods.org). To instal
it, simply add the following line to your Podfile:
```ruby
-pod "UIDevice-Utils" , :git => 'https://github.com/giuseppenucifora/UIDevice-Utils.git'
-
-or
-
pod "UIDevice-Utils"
```
diff --git a/UIDevice-Utils.podspec b/UIDevice-Utils.podspec
index 968f718..0b54462 100644
--- a/UIDevice-Utils.podspec
+++ b/UIDevice-Utils.podspec
@@ -7,26 +7,26 @@
#
Pod::Spec.new do |s|
- s.name = "UIDevice-Utils"
- s.version = "0.1.2"
- s.summary = "Category on UIDevice to distinguish between platforms."
- s.description = "Category to easy distinguish devices, family platform device, or device inches. Provide human-readable device names e.g. 'iPhone 6S Plus' or enums e.g. 'UIDeviceGenerationModeliPhone6SPlus'"
- s.homepage = "https://github.com/giuseppenucifora/UIDevice-Utils"
- # s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2"
- s.license = 'MIT'
- s.author = { "Giuseppe Nucifora" => "me@giuseppenucifora.com" }
- s.source = { :git => "https://github.com/giuseppenucifora/UIDevice-Utils.git", :tag => s.version.to_s }
- # s.social_media_url = 'https://twitter.com/'
+s.name = "UIDevice-Utils"
+s.version = "0.1.4"
+s.summary = "Category on UIDevice to distinguish between platforms."
+s.description = "Category to easy distinguish devices, family platform device, or device inches. Provide human-readable device names e.g. 'iPhone 6S Plus' or enums e.g. 'UIDeviceGenerationModeliPhone6SPlus'"
+s.homepage = "https://github.com/giuseppenucifora/UIDevice-Utils"
+# s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2"
+s.license = 'MIT'
+s.author = { "Giuseppe Nucifora" => "me@giuseppenucifora.com" }
+s.source = { :git => "https://github.com/giuseppenucifora/UIDevice-Utils.git", :tag => s.version.to_s }
+# s.social_media_url = 'https://twitter.com/'
- s.platform = :ios, '7.0'
- s.requires_arc = true
+s.platform = :ios, '8.0'
+s.requires_arc = true
- s.source_files = 'Pod/Classes/**/*'
- s.resource_bundles = {
- 'UIDevice-Utils' => ['Pod/Assets/*.png']
- }
+s.source_files = 'Pod/Classes/**/*'
+s.resource_bundles = {
+'UIDevice-Utils' => ['Pod/Assets/*.png']
+}
- # s.public_header_files = 'Pod/Classes/**/*.h'
- # s.frameworks = 'UIKit', 'MapKit'
- # s.dependency 'AFNetworking', '~> 2.3'
+# s.public_header_files = 'Pod/Classes/**/*.h'
+# s.frameworks = 'UIKit', 'MapKit'
+# s.dependency 'AFNetworking', '~> 2.3'
end