• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Stopping the initial storyboard viewcontroller being created
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Stopping the initial storyboard viewcontroller being created


  • Subject: Stopping the initial storyboard viewcontroller being created
  • From: Roland King <email@hidden>
  • Date: Thu, 26 Nov 2015 21:27:36 +0800

I would like to create the main viewcontroller in my applicationDidFinishLaunching:withOptions: method (iOS) instead of having the storyboard one created automatically.

I’m doing this in order to change behaviour between simulator and device as the simulator doesn’t support BlueTooth, so I need to fix in a simulated version.

I have the code to create the initial view controller and fix it up

		let storyboard = UIStoryboard(name: "Main", bundle: nil)
		self.window?.rootViewController = storyboard.instantiateInitialViewController()
		// make a fix to the viewcontroller here
		self.window?.makeKeyAndVisible()

however I’ve found that standard machinery still creates one for me so I end up with two of them, possibly with the one I want on-screen, possibly not, and the first one created doesn’t do the decent thing and release itself either, so two of them persist. (I don’t understand what’s referencing it either, when I assign to the rootViewController it ought to go away but doesn’t).

How do I stop the standard storyboard initial viewcontroller load so I can do it myself.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Stopping the initial storyboard viewcontroller being created
      • From: Michael Babin <email@hidden>
    • Re: Stopping the initial storyboard viewcontroller being created
      • From: Cosmo Birch <email@hidden>
  • Prev by Date: Re: Fade when changing window's rootViewController possible?
  • Next by Date: Re: Stopping the initial storyboard viewcontroller being created
  • Previous by thread: Re: Cocoa-dev Digest, Vol 12, Issue 656
  • Next by thread: Re: Stopping the initial storyboard viewcontroller being created
  • Index(es):
    • Date
    • Thread