My application uses two UIWindows, a first running the main application and a second running some stuff to be shown in foreground of all. Both windows have a view controller. When the split view size of my application changes, viewWillTransitionToSize is called on the main applications UIViewController, but not on the viewController of the second window. When the orientation of the application changes, both methods are called. What can I do, that both viewWillTransitionToSize selectors are called?

1

There are 1 best solutions below

0
On

As an workaround I'm observing the main application window size ...

    [[UIApplication sharedApplication].delegate.window 
        addObserver:self 
        forKeyPath:@"frame" 
        options:0 
        context:0];

... and update the layout of the second window content:

    -(void)observeValueForKeyPath:(NSString *)keyPath 
        ofObject:(id)object 
        change:(NSDictionary *)change 
        context:(void *)context {

        if (object == [UIApplication sharedApplication].delegate.window) {
            [self updateLayout];
        }    
    }