I needed to see touch events in my window, so I subclassed UIWindow to make my MYWindow class. I override the sentEvent function to receive touch events in a window, and all this works fine. To do this, I did the following:
self.window = [[MYWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[window makeKeyAndVisible]
The problem I am facing is that when I do this, the viewControllers that are in this window will no longer rotate. If I used the regular UIWindow, they all worked the same way I intended them to work. Obviously, something is wrong with my setup.
I was browsing the UIWindow header file, and there is a method called
- (void)becomeKeyWindow; //override point for subclass, Do Not call directly
I assume to implement this in my custom UIWindow class in the same way as I had to implement the sendEvent method :? Please point me in the right direction.
Thanks in advance guys.
Bittu source
share