I have a storyboard that is getting too large in my Xcode project and slowing down my computer. How do I programmatically (or manually using storyboarding) go from one of my views in the current storyboard using a button to advance to a view on the new storyboard?
Semi-new with Xcode so the simpler the better. Thanks!
You need to give your viewcontroller an identifier. You do that by highlighting your view controller and then give it a identifier: You then put your identifier in StoryBoard ID.
The answer is YES! Here we will be discussing a simple way to use SwiftUI into our existing project, which already consists of a storyboard.
You can do it programatically this way:
Swift 3+
let storyboard = UIStoryboard(name: "StoryboardName", bundle: nil) let vc = storyboard.instantiateViewController(withIdentifier: "ViewControllerID") as UIViewController present(vc, animated: true, completion: nil)
Older
let storyboard = UIStoryboard(name: "myStoryboardName", bundle: nil) let vc = storyboard.instantiateViewControllerWithIdentifier("nextViewController") as UIViewController presentViewController(vc, animated: true, completion: nil)
In Sort you can do it like:
presentViewController( UIStoryboard(name: "myStoryboardName", bundle: nil).instantiateViewControllerWithIdentifier("nextViewController") as UIViewController, animated: true, completion: nil)
And don't forget to give ID to your nextViewController.
For more Info refer THIS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With