Overriding storyboard inside of a framework

Hello I have created a framework and together with framework we add storyboard files. Client has edited storyboards files and he wanted to add custom storyboard inside of his application. He added storyboard in his application with the same name as mine in the framework .I have tried many ways of creating VC in order to get the client’s storyboard instead of mine… I finally finished…
let vc = UIStoryboard.init(name:“Storyboard”, bundle:Bundle.main).instantiateViewController(withIdentifier: “NewIdentifier”)

self .navigationController?.pushViewController(vc!, animated: true )
However, it still can’t find any outlets from mine framework… how can I override storyboard from the framework with custom, provided by client?

Hi @wellbranding,
When you get a normal instance of a ViewController, that is exactly what it is, a standard UIViewController, not your custom viewController that is derived from this as the base. So you have to cast this as your customViewController when you instantiate and your outlets would all be available - because the standard ViewController does not have your outlets.


1 Like

This topic was automatically closed after 166 days. New replies are no longer allowed.