Detect if app is running in Slide Over or Split View mode in iOS 9

后端 未结 15 2432
死守一世寂寞
死守一世寂寞 2020-12-04 15:31

In iOS 9, is it possible to detect when an app is running in iOS 9\'s Slide Over or Split View mode?

I\'ve tried reading through Apple\'s documentation on iOS 9 mult

15条回答
  •  春和景丽
    2020-12-04 16:10

    Adding to @Tamas's answer:
    Here is the code snippet that will automatically maintain this flag irrespective of rotation.

     -(void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection
    {
     // simply create a property of 'BOOL' type
     isRunningInFullScreen = CGRectEqualToRect([UIApplication sharedApplication].delegate.window.frame, [UIApplication sharedApplication].delegate.window.screen.bounds);
    }
    

提交回复
热议问题