Skip to content

Commit 3fcaabd

Browse files
committed
Added landscape support 🆕 🎉
1 parent 2bc38d1 commit 3fcaabd

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

SDiPhoneVersion/SDiPhoneVersion.m

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,23 +74,14 @@ +(DeviceVersion)deviceVersion {
7474
+(DeviceSize)deviceSize {
7575

7676
CGFloat screenHeight;
77-
7877
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
7978

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

8382
else if((orientation == UIDeviceOrientationLandscapeRight) || (orientation == UIInterfaceOrientationLandscapeLeft))
8483
screenHeight = [[UIScreen mainScreen] bounds].size.width;
85-
86-
CGFloat screenHeight = ({
87-
// consider landscape orientation status
88-
UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
89-
BOOL isLandscape = (orientation == UIDeviceOrientationLandscapeLeft || orientation == UIDeviceOrientationLandscapeRight);
90-
CGFloat screenHeight = [[UIScreen mainScreen] bounds].size.height;
91-
CGFloat screenWidth = [[UIScreen mainScreen] bounds].size.width;
92-
screenHeight = isLandscape ? screenWidth : screenHeight;
93-
});
84+
9485

9586
if (screenHeight == 480)
9687
return iPhone35inch;

0 commit comments

Comments
 (0)