every UIViewController has a method called willRotateToInterface.
Is it possible to do this within a UIView too?
Does this match the idea of model view controller ?
The only way I can think of is to send the event from the UIViewController to the UIView.
Is there a global variable for the current orientation?
Observe
UIDeviceOrientationDidChangeNotification:UIDevice Class Reference
I should note that yo uneed to add
-beginGeneratingDeviceOrientationNotificationswhen you want these notifications to be sent, and call-endGeneratingDeviceOrientationNotificationswhen you want them to stop. There is a battery impact of generating these, so you should only do so when your view is on screen.UIViewControllerdoes all this for you, so if you have a view controller, it is worth letting it do the work.