-3

I am trying to create a universal app, and I am just wondering how I write the following code to direct it to iPad version of app. Specifically what should the navtiveBounds.height be for the iPad Air and Mini. Thanks So Much :)

if UIScreen.mainScreen().nativeBounds.height == 2208 {
            println("iPhone 6+")
            let delay = SKAction.waitForDuration(1)
            let transition = SKAction.runBlock({
                let scene = Menu6Plus(size: self.size)
                self.view?.presentScene(scene)
            })

            runAction(SKAction.sequence([delay, transition]))


        }
user3808792
  • 103
  • 1
  • 2
  • 5
  • 3
    Instead of posting a question like this, why not simply run your app on an iPad (real or simulated) and see what value you get. – rmaddy Jan 18 '15 at 17:05

1 Answers1

0

You can use:

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
    // Code for iPad!
}

Also, I believe that if you were to use the nativeBounds property to determine screen size, iPad and iPad mini would both return the same 1024-by-768 resolution. If you really need to detect if the user is running an iPad Mini at runtime, try this:

Is it possible to detect that your iOS app is running on an iPad mini at runtime?

Community
  • 1
  • 1
scott
  • 1,194
  • 7
  • 18