TruMan1
TruMan1

Reputation: 36158

Package XIB in Swift framework for distribution?

I'm creating a Swift framework so I can distribute it via CocoaPods and Carthage. My question is if it is possible to distribute a .xib files in my framework? If so, how would the consuming developer use it?

Upvotes: 0

Views: 1049

Answers (1)

Max
Max

Reputation: 774

You can load your .xib file from your framework like this :

UINib(nibName: "MyXib", bundle: NSBundle(identifier: "bundleName")

or if you know the name of a class in the framework

UINib(nibName: "MyXib", bundle: NSBundle(forClass: MyClass.self)

Upvotes: 1

Related Questions