How to design iPad Landscape and Portrait screens with different Layouts using Size class. I could find only w-regular and h-regular for both orientations. Example: I need to align 2 views vertically in portrait and horizontally in landscape using Size Class
Finally I found a solution :
if traitCollection.verticalSizeClass == .Regular && traitCollection.horizontalSizeClass == .Regular {
var orientation:UIInterfaceOrientation = UIApplication.sharedApplication().statusBarOrientation;
if orientation == UIInterfaceOrientation.LandscapeLeft || orientation == UIInterfaceOrientation.LandscapeRight {
// orientation is landscape
} else {
// orientation is portrait
}
}