Reputation: 519
I am looking for the best way to notify all the viewControllers
of UIInterfaceOrientation
changing that is detected in first-viewController added to mainWindow.
Do I have to NSNotification
in the controller where these events are detected and other controllers will subscribe to that? Or there is any cleaner way?
Thanks for the help!!!
Upvotes: 1
Views: 3011
Reputation: 5186
Add UIApplicationDidChangeStatusBarOrientationNotification
in viewDidLoad which anyView you wanted to notify would be better.
Upvotes: 2
Reputation: 26972
Your UIViewController already get rotation notification messages:
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
and
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
and also
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration
Upvotes: 0