"UIScreen mainScreen] applicationFrame]" for landscape mode

I have to ask about it. Using

[[UIScreen mainScreen] applicationFrame] 

This is a great way to get your iphone or ipad workspace in portrait mode. But, if I want to get the same size in the landscape, there is different code, or I will need to create:

 CGRect landscape = CGRectMake(0, 20, 1024, 748) 

This is not even common for iPhone and iPad.

+6
source share
1 answer

You can use [[[UIApplication sharedApplication] keyWindow] frame]

+2
source

Source: https://habr.com/ru/post/894205/


All Articles