I figured out what was wrong with it:
this was what I was doing:
for await _ in NotificationCenter.default.notifications(named: UIDevice.orientationDidChangeNotification, object: self) {
print("orientation changed") // This would never fire
}
I changed it to:
for await _ in NotificationCenter.default.notifications(named: UIDevice.orientationDidChangeNotification) {
print("orientation changed") // This works
}
I guess I misunderstood what that object param was used for.
Topic:
Community
SubTopic:
Apple Developers
Tags: