UIDevice.current.orientation.isPortrait is not working in xcode simulator for iphone 8, 8 plus and 10

Hello, I am currently working in an iphone app that requires the app to determine the current orientation value of the device. To obtain this, I used UIDevice.current.orientation.isPortrait property and was/is working fine until iphone 7 plus. After updating to recent apple release, when testing on iphone 8, 8 plus and 10, I am getting false result even when the orientation is portrait. In fact, UIDevice.current.orientation.rawValue is returning 0 and UIDevice.current.orientation.isValid is returning false.
On iphones 7 plus and lower, the code running absolutely fine.

Replies

Same thing here, did you find a solution?