From 2f80fa869b2dc761dbf708d2d3b22168103eccec Mon Sep 17 00:00:00 2001 From: Sebastian Mamczak Date: Thu, 15 Oct 2020 21:29:01 +0200 Subject: [PATCH] Added missing class var and restored the documentation --- NibView.swift | 4 ++++ Sources/NibLoadable.swift | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) 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