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

Accepted Reply

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

Replies

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