I tried :
if UIDevice.current.orientation == UIDeviceOrientation.portraitUpsideDown {
print ("UpsideDown")
}
I have rotated the simulator UpsideDown ,but It looks like the simulator cant catch that. I dont know if this works in real device .. I have no device to test that. Is this a simulator bug ? what can I do to detect the orientation ?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.