if UIDeviceOrientationIsLandscape(UIDevice.currentDevice().orientation) {
print(\"landscape\")
}
if UIDeviceOrientationIsPortrait(UIDevice.currentDev
Swift 3+
switch UIDevice.current.orientation {
case .faceUp:
print("flat - up")
case .faceDown:
print("flat - down")
case .landscapeLeft:
print("landscape - left")
case .landscapeRight:
print("landscape - right")
case .portrait:
print("portrait - normal")
case .portraitUpsideDown:
print("portrait - upsideDown")
case .unknown:
print("unknown")
}