title: How to to determinate in Swift the current width of the app when in Split View?
body: <p><strong>EDIT</strong>: I have a project with a row of buttons on top on it. Usually the buttons are 5 in Compact view and 6 in Regular view. I would like to remove a button when the app runs in 1/3 Split View. How can I determine the width of the app?</p>
  
  <p>I'm using this code to determinate the current width of the app when in Split View (multitasking):</p>
  
  <pre><code>    override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
  
          // works but it's deprecated:
          let currentWidth = UIScreen.mainScreen().applicationFrame.size.width
  
          print(currentWidth)
      }
  </code></pre>
  
  <p>It works, but unfortunately applicationFrame is deprecated in iOS 9, so I'm trying to replace it with this:</p>
  
  <pre><code>    override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
  
          // gives you the width of the screen not the width of the app:
          let currentWidth = UIScreen.mainScreen().bounds.size.width
  
          print(currentWidth)
      }
  </code></pre>
  
  <p>The problem is that the first statement gives you the effective width of the app and it's fine, instead the second one, gives you the width of the screen, so you can't use it to learn the real width of the app when it is in Split View.</p>
  
  <p>Would someone know what code would be necessary to replace this deprecated statement?</p>
  
  <pre><code>let currentWidth = UIScreen.mainScreen().applicationFrame.size.width // deprecated
  </code></pre>