jeudi 1 janvier 2015

I have been searching around for the code to be able to do the same thing, but one is for iPhones and another for iPads. I am using swift,

I have been searching around for the code to be able to do the same thing, but one is for iPhones and another for iPads. I am using swift, and the following code is not doing what it is suppose to do. Could anyone answer why?



import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?




func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

func grabStoryboard() -> UIStoryboard {
var storyboard = UIStoryboard()
var height = UIScreen.mainScreen().bounds.size.height

if height == 480/568/667/736{
storyboard = UIStoryboard(name: "iPhone", bundle: nil)
} else {
if height == 768{
storyboard = UIStoryboard(name: "iPad", bundle: nil)
}
}
return storyboard
}


Thank You all in advanced!




Aucun commentaire:

Enregistrer un commentaire