I want to get notified when user changes iPad orientation. In UIKit that was easy but I do not know how we can get that information with SwiftUI?
How we can find out iPad orientation in SwiftUI, automatically getting notification or get update with a function?
398 views Asked by ios coder At
1
You can try:
or:
If you want to detect notifications you can listen to
UIDevice.orientationDidChangeNotification
:Here is a demo: