if UIDeviceOrientationIsLandscape(UIDevice.currentDevice().orientation) {
print(\"landscape\")
}
if UIDeviceOrientationIsPortrait(UIDevice.currentDev
SWIFT 4.2
if UIDevice.current.orientation == UIDeviceOrientation.landscapeLeft {
print("Landscape Left")
}
else if UIDevice.current.orientation == UIDeviceOrientation.landscapeRight{
print("Landscape Right")
}
else if UIDevice.current.orientation == UIDeviceOrientation.portraitUpsideDown{
print("Portrait Upside Down")
}
else if UIDevice.current.orientation == UIDeviceOrientation.portrait {
print("Portrait")
}