diff --git a/NibView.swift b/NibView.swift index a673d3c..c3113ba 100644 --- a/NibView.swift +++ b/NibView.swift @@ -17,6 +17,10 @@ open class NibView: UIView, NibLoadable { return String(describing: self) } + open class var bundle: Bundle { + return Bundle(for: self) + } + open override func awakeAfter(using aDecoder: NSCoder) -> Any? { return nibLoader.awakeAfter(using: aDecoder, super.awakeAfter(using: aDecoder)) } diff --git a/Sources/NibLoadable.swift b/Sources/NibLoadable.swift index 13fdc0d..e0157a9 100644 --- a/Sources/NibLoadable.swift +++ b/Sources/NibLoadable.swift @@ -24,11 +24,11 @@ import UIKit *Optionally* provide custom nib name (defaults to type name): - static var nibName: String { return "MyCustomView" } + class var nibName: String { return "MyCustomView" } *Optionally* provide custom bundle (defaults to class location): - static var bundle: Bundle { return Bundle(for: self) } + class var bundle: Bundle { return Bundle(for: self) } # Refencing from IB