Not outdated and will work with any device screen size (including future screen sizes that Apple will release this year).
-(void)viewDidLayoutSubviews { NSLog(@"%@", self.view.frame.size.width == fminf([[UIScreen mainScreen] bounds].size.width, [[UIScreen mainScreen] bounds].size.height) ? @"Portrait" : @"Landscape"); }
Thanks to @anneblue for helping me shorten the code!
Albert ranshaw
source share