Home Swift: how to switch statusbar orientation in IOS 9+?
Reply: 0

Swift: how to switch statusbar orientation in IOS 9+?

user1028 Published in July 15, 2018, 9:13 pm

I'm building a game that is based on gestures. IOS' native gestures that bring in notification center and control center on side swipe are super annoying as they interfere with gameplay.

Having searched extensively for a solution, I have come to belive that there is no way to disable/block control center or notification center on app level.

One possible solution that could help that I found was to turn the status bar orientation. My app runs in landscape orientation. If I could switch notification/control centers from top and bottom swipe to left and right swipes, I think that could almoast solve my problem.

However this seems to be possible but depreceted since IOS 9: https://developer.apple.com/documentation/uikit/uiapplication/1622939-setstatusbarorientation?language=objc

Apple suggests to use UITraitCollection instead. However I can't figure out how to change the orientation of the status bar using this. Sample code would be greatly appreciated!

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.309743 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO