Armands L.
Armands L.

Reputation: 1935

iOS 7 Class size compatibility

I've read Apple Documentation about Class sizes and their backward compatibility.

It says, that most classes are compatible with iOS 7 and the main restriction is Compact Height value for iPhone.

Has anyone managed to separate iPhone landscape orientation from portrait? It works great for separating iPads from iPhones, but I didn't get any results for iPhone.

I tried: Portrait: wCompact - hRegular Landscape(default): Any - Any

It always uses Portrait version for both orientations.

Upvotes: 0

Views: 79

Answers (1)

Pratik Patel
Pratik Patel

Reputation: 1421

Create a class to get CGRect:

.h file

@interface FullScreen : UIScreen
+ (CGRect)iOS7StyleScreenBounds;
@end

.m file

#import "FullScreen.h"

@implementation FullScreen
+ (CGRect)iOS7StyleScreenBounds {
UIScreen *screen = [UIScreen mainScreen]; CGRect screenRect;
if (![screen respondsToSelector:@selector(fixedCoordinateSpace)] && UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
    screenRect = CGRectMake(screen.bounds.origin.x, screen.bounds.origin.y, screen.bounds.size.height, screen.bounds.size.width);
} else {
    screenRect = screen.bounds;
}
return screenRect;
}
@end

and call this class like: [FullScreen iOS7StyleScreenBounds]; in your .m file

Upvotes: 0

Related Questions