Use: You can examine the view's trait collection to determine its horizontal and vertical size class.
if ([self.view respondsToSelector:@selector(traitCollection)]){
if (self.view.traitCollection.horizontalSizeClass == UIUserInterfaceSizeClassCompact) {
...
}
}
Implement the traitCollectionDidChange:
method to automatically be called when a trait changes due to autorotation.For more information, see UITraitCollection Class Reference and UITraitEnvironment Protocol Reference.
References:
No comments:
Post a Comment