Merge pull request #454 from mlequeux/master
Proper Bundle loading when linking with static libraries
This commit is contained in:
commit
835570c855
|
|
@ -321,7 +321,14 @@ open class ExampleBaseButtonBarPagerTabStripViewController: BaseButtonBarPagerTa
|
|||
}
|
||||
|
||||
open func initialize() {
|
||||
buttonBarItemSpec = .nibFile(nibName: "ButtonCell", bundle: Bundle(for: ButtonBarViewCell.self), width: { [weak self] (childItemInfo) -> CGFloat in
|
||||
var bundle = Bundle(for: ButtonBarViewCell.self)
|
||||
if let resourcePath = bundle.path(forResource: "XLPagerTabStrip", ofType: "bundle") {
|
||||
if let resourcesBundle = Bundle(path: resourcePath) {
|
||||
bundle = resourcesBundle
|
||||
}
|
||||
}
|
||||
|
||||
buttonBarItemSpec = .nibFile(nibName: "ButtonCell", bundle: bundle, width: { [weak self] (childItemInfo) -> CGFloat in
|
||||
let label = UILabel()
|
||||
label.translatesAutoresizingMaskIntoConstraints = false
|
||||
label.font = self?.settings.style.buttonBarItemFont ?? label.font
|
||||
|
|
|
|||
|
|
@ -101,7 +101,15 @@ open class ButtonBarPagerTabStripViewController: PagerTabStripViewController, Pa
|
|||
|
||||
open override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
buttonBarItemSpec = .nibFile(nibName: "ButtonCell", bundle: Bundle(for: ButtonBarViewCell.self), width: { [weak self] (childItemInfo) -> CGFloat in
|
||||
|
||||
var bundle = Bundle(for: ButtonBarViewCell.self)
|
||||
if let resourcePath = bundle.path(forResource: "XLPagerTabStrip", ofType: "bundle") {
|
||||
if let resourcesBundle = Bundle(path: resourcePath) {
|
||||
bundle = resourcesBundle
|
||||
}
|
||||
}
|
||||
|
||||
buttonBarItemSpec = .nibFile(nibName: "ButtonCell", bundle: bundle, width: { [weak self] (childItemInfo) -> CGFloat in
|
||||
let label = UILabel()
|
||||
label.translatesAutoresizingMaskIntoConstraints = false
|
||||
label.font = self?.settings.style.buttonBarItemFont
|
||||
|
|
|
|||
Loading…
Reference in New Issue