title: App opens launch screen but crashes (On iOS Device)
body: <p>I am having a bit of trouble trying to test my app on a physical device. Every time I go and test my app through <code>TestFlight</code> it just opens the <code>LaunchScreen</code> for a split second then crashes. This is strange because it works perfectly in the simulator. </p>
  
  <p>I'm not using <code>StoryBoards</code> and I've read around, and people said to get rid of all of the main <code>Storyboard</code> references in <code>info.plist</code> and the build settings. I have done so and it still isn't working. </p>
  
  <p>I have attached screenshots below:</p>
  
  <p><strong>Info.plist</strong></p>
  
  <p><a href="https://i.stack.imgur.com/gxV1f.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gxV1f.png" alt="enter image description here"></a></p>
  
  <p><strong>Build Settings</strong></p>
  
  <p><a href="https://i.stack.imgur.com/sNqKQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sNqKQ.png" alt="enter image description here"></a></p>
  
  <p>Also, I have a feeling it could be something to do with my <code>AppDelegate</code>, due to me trying to do everything programatically.</p>
  
  <p><strong>AppDelegate.swift</strong></p>
  
  <pre><code>@UIApplicationMain
  class AppDelegate: UIResponder, UIApplicationDelegate 
  {
      var window: UIWindow?
  
      func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -&gt; Bool 
      {
          // Override point for customization after application launch.
          self.window = UIWindow(frame:UIScreen.mainScreen().bounds)
  
          let navController = UINavigationController()
          let mainViewController = ViewController(nibName:nil, bundle:nil)
  
          // NavigationBar/Title colour
          navController.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName:UIColor.whiteColor()]
          UINavigationBar.appearance().barTintColor = UIColor(red:3/255, green:60/255, blue:115/255, alpha:1);
  
  
          // Push the viewcontroller onto the navigation controller
          navController.pushViewController(mainViewController, animated:false)
  
          self.window!.rootViewController = navController
          self.window?.makeKeyAndVisible()
  
          return true
      }
  
      func applicationWillResignActive(application: UIApplication) 
      {
          // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
          // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
      }
  
      func applicationDidEnterBackground(application: UIApplication) 
      {
          // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
          // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
      }
  
      func applicationWillEnterForeground(application: UIApplication) 
      {
          // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
      }
  
      func applicationDidBecomeActive(application: UIApplication) 
      {
          // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
      }
  
      func applicationWillTerminate(application: UIApplication) 
      {
          // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
      }
  }
  </code></pre>
  
  <p><strong>ViewController.swift - ViewDidLoad()</strong></p>
  
  <pre><code>override func viewDidLoad() 
      {
          super.viewDidLoad()
  
          self.title = "MyApp"
          self.view.backgroundColor = UIColor.whiteColor()
          self.navigationController!.navigationBar.barTintColor = UIColor(red: 0, green: 40/255, blue: 99/255, alpha: 1)
          self.navigationController!.navigationBar.tintColor = UIColor.whiteColor()
  
  
          // container
          mainContainer = UIView()
  
          // button
          btn_Schedule = UIButton()
          btn_Career = UIButton()
          btn_Social = UIButton()
          btn_Feedback = UIButton()
          btn_Details = UIButton()
  
          // Label
          lbl_Copywrite = UILabel()
  
          // Horizontal Dividing lines
          dividingLineTop = UIView()
          dividingLineBottom = UIView()
  
          // images
          img_Schedule = UIImage()
          img_Career = UIImage()
          img_Social = UIImage()
          img_Feedback = UIImage()
          img_Details = UIImage()
  
          img_Schedule = UIImage(named:"imgschedule.PNG")
          img_Career = UIImage(named:"imgcareer.PNG")
          img_Social = UIImage(named:"imgsocial.PNG")
          img_Feedback = UIImage(named:"contact.PNG")
          img_Details = UIImage(named:"imgdetails.PNG")
  
          // set up button clicks
          btn_Schedule.addTarget(self, action:"onMyScheduleButton_Clicked:", forControlEvents: UIControlEvents.TouchUpInside)
          btn_Career.addTarget(self, action:"onMyCareerButton_Clicked:", forControlEvents: UIControlEvents.TouchUpInside)
          btn_Social.addTarget(self, action:"onMySocialButton_Clicked:", forControlEvents: UIControlEvents.TouchUpInside)
          btn_Feedback.addTarget(self, action:"onFeedbackButton_Clicked:", forControlEvents: UIControlEvents.TouchUpInside)
          btn_Details.addTarget(self, action:"onMyDetailsButton_Clicked:", forControlEvents: UIControlEvents.TouchUpInside)
  
          if UIDevice.currentDevice().orientation.isLandscape.boolValue
          {
              displayMenuInLandscapeMode()
          }
          else 
          {
              if(UIDevice.currentDevice().userInterfaceIdiom == UIUserInterfaceIdiom.Pad)
              {
                  displayMenuInLandscapeMode()
              }
              else
              {
                  displayMenuInPortraitMode()
              }
          }
      }
  </code></pre>
  
  <p>If anyone could help that would be great.</p>