Skip to content

Commit

Permalink
#14 Fixes for reusableViewType call
Browse files Browse the repository at this point in the history
  • Loading branch information
malcommac committed May 23, 2019
1 parent abfdc44 commit 434469a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Sources/Shared/Protocols/ReusableCellViewProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,16 @@ public extension ReusableCellViewProtocol {
}

static func reusableViewIdentifier() -> String {
return String(describing: reusableViewType)
return String(describing: reusableViewType())
}

static func registerReusableView(inTable table: UITableView?, as type: ReusableViewRegistrationType) {

let reusableID = reusableViewIdentifier()
let reusableClass: AnyClass = reusableViewClass()
let reusableSource = reusableViewSource()

switch reusableViewSource() {
switch reusableSource {
case .fromStoryboard:
if type.isHeaderFooter {
fatalError("Cannot load header/footer from storyboard. Use another source (xib/class) instead.")
Expand Down Expand Up @@ -83,8 +84,9 @@ public extension ReusableCellViewProtocol {

let reusableID = reusableViewIdentifier()
let reusableClass: AnyClass = reusableViewClass()
let reusableSource = reusableViewSource()

switch reusableViewSource() {
switch reusableSource {
case .fromStoryboard:
if type.isHeaderFooter {
fatalError("Cannot load header/footer from storyboard. Use another source (xib/class) instead.")
Expand Down

0 comments on commit 434469a

Please sign in to comment.