10
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

iPadのマルチタスキングSplit Viewで表示されているかの判定

Last updated at Posted at 2015-09-06

iPad Air 2以降で使えるマルチタスキング機能Slide Over and Split Viewで表示されて操作可能状態にあるかどうかの判定です。

条件はiPadでアプリ側keyWindowの幅がデバイス画面幅の半分以下としています。

BOOL isInSplitView
= (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad
   && (CGRectGetWidth([UIApplication sharedApplication].keyWindow.frame)
       <= CGRectGetWidth([[UIScreen mainScreen] bounds]) * 0.5f));

ちなみに[UIScreen mainScreen].applicationFrameはiOS 9でdeprecatedとなります。

参考: :link: Getting Started with Multitasking on iPad in iOS 9

10
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?