Monday, September 10, 2018

How to load view View controller from storyboard inside an iOS framework?

        let podBundle = Bundle(for: FrameworkViewController.self)
        let storyboard = UIStoryboard(name: "Storyboard", bundle: podBundle)
        let vc = storyboard.instantiateInitialViewController()!
        parentController.present(vc, animated: true, completion: nil)


important point is to get the bundle object for the bundle which is holding the storyboard and the class essentially. 

No comments:

Post a Comment