Skip to content

Commit

Permalink
Added landscape support 🆕 🎉
Browse files Browse the repository at this point in the history
  • Loading branch information
sebyddd committed Oct 30, 2014
1 parent 2bc38d1 commit 3fcaabd
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions SDiPhoneVersion/SDiPhoneVersion.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,14 @@ +(DeviceVersion)deviceVersion {
+(DeviceSize)deviceSize {

CGFloat screenHeight;

UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];

if (orientation == UIDeviceOrientationPortrait)
screenHeight = [[UIScreen mainScreen] bounds].size.height;

else if((orientation == UIDeviceOrientationLandscapeRight) || (orientation == UIInterfaceOrientationLandscapeLeft))
screenHeight = [[UIScreen mainScreen] bounds].size.width;

CGFloat screenHeight = ({
// consider landscape orientation status
UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
BOOL isLandscape = (orientation == UIDeviceOrientationLandscapeLeft || orientation == UIDeviceOrientationLandscapeRight);
CGFloat screenHeight = [[UIScreen mainScreen] bounds].size.height;
CGFloat screenWidth = [[UIScreen mainScreen] bounds].size.width;
screenHeight = isLandscape ? screenWidth : screenHeight;
});


if (screenHeight == 480)
return iPhone35inch;
Expand Down

0 comments on commit 3fcaabd

Please sign in to comment.