Reputation: 36158
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
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