Instantiate Storyboard from local Swift Package

Hi,

I try to instatiat a ViewController vom a local SPM Package but I always get the error Could not find a storyboard.

let myViewController = UIStoryboard(name: ",yStoryboard", bundle: Bundle(url: Bundle.main.url(forResource: "myModule_myModule", withExtension: "bundle")!)).instantiateViewController(withIdentifier: "MyViewController")

This code works when using it as an remote package. What I'm doing wrong?

Thanks Bernhard

Answered by bernhard132 in 718108022

Hi,

I found the solution. When you use local Packages you need to add it manually in your Target's General settings, under Frameworks, Libraries, and Embedded Content.

Best Bernhard

Accepted Answer

Hi,

I found the solution. When you use local Packages you need to add it manually in your Target's General settings, under Frameworks, Libraries, and Embedded Content.

Best Bernhard

Instantiate Storyboard from local Swift Package
 
 
Q