Skip to content

Commit

Permalink
Added missing class var and restored the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
smamczak committed Oct 15, 2020
1 parent 280efd2 commit 2f80fa8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions NibView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/NibLoadable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2f80fa8

Please sign in to comment.