Abu Eesa Abu Eesa - 1 year ago 88
iOS Question

Removed initial view controller from Storyboard

I've removed initial view pointer (-> arrow which decides first view) from storyboard, am setting it programmatically. Since my app should load tutorial if it's first launch & from next time it should go to login .

I've done that using code, but now when am working on other screens & I want to test that particular screen only, am coming from all the screen in flow till that screen. When am setting that screen which I want to test as initial view, nothing is happing since I've overridden that functionality with my code, but I'll need that to set any screen as initial view temporarily for testing purpose.

Please tell me what should I do?

Answer Source

Use this code:

let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let entryPoint = storyboard.instantiateInitialViewController()
appDelegate.window?.rootViewController = entryPoint

Whichever Initial View Controller you assign, this will pick that one particularly.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download