From 434469aaf0b1a7d4fca2a83ce95f8cca0d335f77 Mon Sep 17 00:00:00 2001 From: Daniele Margutti Date: Thu, 23 May 2019 12:55:43 +0200 Subject: [PATCH] #14 Fixes for reusableViewType call --- Sources/Shared/Protocols/ReusableCellViewProtocol.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Sources/Shared/Protocols/ReusableCellViewProtocol.swift b/Sources/Shared/Protocols/ReusableCellViewProtocol.swift index d005a7c..ba8d08e 100644 --- a/Sources/Shared/Protocols/ReusableCellViewProtocol.swift +++ b/Sources/Shared/Protocols/ReusableCellViewProtocol.swift @@ -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.") @@ -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.")