Abbut John
Abbut John

Reputation: 133

Is it possible to develop an iOS framework with storyboard?

Is it possible to develop an iOS Framework with Storyboard and its view controller in it? While I initialise the entry method in framework from any iOS app , it's required to go to the storyboard which we bundled with framework.

Upvotes: 4

Views: 3421

Answers (3)

yoAlex5
yoAlex5

Reputation: 34225

[iOS Framework] is just a container for sources and resources(like .storyboard).

When you build framework with .storyboard you get something like

Here you can find .storyboardc which is compiled .storyboard

[Get storyboard from a framework]

Upvotes: 0

Rikesh Subedi
Rikesh Subedi

Reputation: 1845

One way of creating UI Framework is to create VCs with nib file. If you have segues defined within the framework, then go for storyboard.

If you are using storyboard, expose UI helper class wherein you can instantiate VCs from storyboard. For eg:

public class Utility {

    public static func getHomeVC() -> UIViewController {

            let storyboard = UIStoryboard.init(name: "HomeScreen", bundle: Bundle(for: self))
            let homeVC = storyboard.instantiateViewController(withIdentifier: "FrameworkHomeVC") 
            return homeVC
    }

}

Upvotes: 3

TawaNicolas
TawaNicolas

Reputation: 646

Yes.

The storyboard is there just to hold your UI. You can use it to instantiate ViewControllers.

The code is separated into code files.

Upvotes: 1

Related Questions