有没有一种特殊的方法来获取 iPhone 的方向?我不需要它的度数或弧度,我希望它返回一个 UIInterfaceOrientation 对象。我只需要它来进行 if-else 构造,例如
if(currentOrientation==UIInterfaceOrientationPortrait ||currentOrientation==UIInterfaceOrientationPortraitUpsideDown) {
//Code
}
if (currentOrientation==UIInterfaceOrientationLandscapeRight ||currentOrientation==UIInterfaceOrientationLandscapeLeft ) {
//Code
}
提前致谢!