Repository: cordova-ios
Updated Branches:
  refs/heads/master cf367cb49 -> b06ca8db4


CB-7596 - [iOS 8] CDV_IsIPhone5() Macro needs to be updated because screen size 
is now orientation dependent

iOS8 introduces a change to screen orientation, making [UIScreen
bounds] orientation-dependent. Testing for the iPhone5 screen
resolution now needs to account for landscape (568x320) in addition to
portrait (320x568).

Details at
http://stackoverflow.com/questions/24150359/is-uiscreen-mainscreen-bound
s-size-becoming-orientation-dependent-in-ios8

Signed-off-by: Shazron Abdullah <shaz...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/b06ca8db
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/b06ca8db
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/b06ca8db

Branch: refs/heads/master
Commit: b06ca8db4288f47e99f32294080106884e236d47
Parents: cf367cb
Author: Clafou <seb@WiggleWorm.local>
Authored: Thu Sep 18 11:18:04 2014 +0100
Committer: Shazron Abdullah <shaz...@apache.org>
Committed: Thu Sep 18 15:27:06 2014 -0700

----------------------------------------------------------------------
 CordovaLib/Classes/CDVAvailability.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/b06ca8db/CordovaLib/Classes/CDVAvailability.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVAvailability.h 
b/CordovaLib/Classes/CDVAvailability.h
index 6f43754..e16a951 100644
--- a/CordovaLib/Classes/CDVAvailability.h
+++ b/CordovaLib/Classes/CDVAvailability.h
@@ -75,7 +75,7 @@
 
 #define CDV_IsIPad() ([[UIDevice currentDevice] 
respondsToSelector:@selector(userInterfaceIdiom)] && ([[UIDevice currentDevice] 
userInterfaceIdiom] == UIUserInterfaceIdiomPad))
 
-#define CDV_IsIPhone5() ([[UIScreen mainScreen] bounds].size.height == 568 && 
[[UIScreen mainScreen] bounds].size.width == 320)
+#define CDV_IsIPhone5() (([[UIScreen mainScreen] bounds].size.width == 568 && 
[[UIScreen mainScreen] bounds].size.height == 320) || ([[UIScreen mainScreen] 
bounds].size.height == 568 && [[UIScreen mainScreen] bounds].size.width == 320))
 
 /* Return the string version of the decimal version */
 #define CDV_VERSION [NSString stringWithFormat:@"%d.%d.%d", \

Reply via email to