Question

Team,

I have extended the UIWindow, this made my landing view controller (rootViewController) disabled i.e., I could not able to interact with it.

EBaseUIWindow is the class that has the UIWindow as a super class. When I replace the EBaseUIWindow with UIWindow i could able to interact with the rootViewController.

What would be the reason?

    self.window = [[EBaseUIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] ;
    self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] ;
    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];
    return YES;

Please suggest?

Working after my below edit in my code:

I had a sendEvent method overridden in my EBaseUIWindow. In that when I added the below line it started to work.

[super sendEvent:event];

Thanks to Daij-Djan for the clue.

Was it helpful?

Solution

without seeing any code of your custom class it's kinda.. guesswork.. there could be many reasons.

BUT

in a way it comes down to 'your window class (or a view or recognizer it adds) consuming the events before they can reach the rootViewController view.

identify places you deal with touches (events in general) and comment them out to see what's causing the issue

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top