Search code examples
uiaccessibility

UIAccessibility on subview of UIWINDOW


Hi have added Viewcontroller view into UIWINDOWS as below

[[[UIApplication sharedApplication] keyWindow] addSubview:self.myviewcontroller.view];

But now for myviewcontroller view UIAccessibility is not working. Its getting whatever backside of that window.


Solution

  • I figured solution, we should add subview on topmost window.

            UIWindow* window = [UIApplication sharedApplication].keyWindow;
        if (!window)
            window = [[UIApplication sharedApplication].windows objectAtIndex:0];
        [[[window subviews] objectAtIndex:0] addSubview:self.myviewController.view];