How do you create multiple storyboards in the same project using Swift? I know I have to go to File -> New -> File and then choose Storyboard, but how do I integrate that storyboard into my project and navigate to the new storyboard's views in Swift code?
Add new storyboard to the project by File->New->File... ->Userinterface->storyboard. Go to project summary and select MainStoryboard and select the storyboard name you just created.
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. Let's dive in then!
You need to get a reference to the desired storyboard
let aStoryboard = UIStoryboard(name: "storyboardName", bundle: nil)
Then instantiate desired view controller
let vc = aStoryboard.instantiateViewControllerWithIdentifier("viewControllerIdentifier") as! UIViewController
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