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 multitasking, but haven't had any luck with this…
I ask because I might have a feature in my app that I'd like to disable when the app is opened in a Slide Over.
Split View allows you to display two apps on the screen in their own resizable panes. You can then add a third app, which resides in the floating pane. Both Slide Over and Split View are supported by the iPad Pro, the 5th generation iPad and later, the iPad Air 2 and later, and the iPad mini 4 and later.
Unfortunately, you can't split your iPhone's screen to use multiple apps at once, at least not in the way you're probably hoping. However, you can use features like picture-in-picture and fast app switching to multitask. We'll show you how to access these options on your phone.
Just check if your window occupies the whole screen:
BOOL isRunningInFullScreen = CGRectEqualToRect([UIApplication sharedApplication].delegate.window.frame, [UIApplication sharedApplication].delegate.window.screen.bounds);
If this is false, then you're running in a split view or a slide over.
Here is the code snipped which 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); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With