File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ struct PhonesHeaderModel {
1717extension PhonesHeaderModel : SupplementaryViewModel , CellConvertible {
1818 typealias Cell = PhonesHeader
1919
20- var height : CGFloat {
20+ var height : Double {
2121 return 50
2222 }
2323}
Original file line number Diff line number Diff line change 66// Copyright © 2018 FUNTASTY Digital, s.r.o. All rights reserved.
77//
88
9- import struct UIKit. CGFloat
10- import class Foundation. Bundle
11- import class UIKit. UINib
12-
139public protocol CellModel : ReusableView {
14- var cellHeight : CGFloat { get }
10+ var cellHeight : Double { get }
1511 var highlighting : Bool { get }
1612 var separatorIsHidden : Bool { get }
1713
1814 func configure( cell: AnyObject )
1915}
2016
2117public extension CellModel {
22- var cellHeight : CGFloat {
23- return 44
18+ var cellHeight : Double {
19+ return 44.0
2420 }
2521
2622 var highlighting : Bool {
@@ -33,7 +29,7 @@ public extension CellModel {
3329}
3430
3531public protocol SupplementaryViewModel : ReusableView {
36- var height : CGFloat { get }
32+ var height : Double { get }
3733
3834 func configure( cell: AnyObject )
3935}
Original file line number Diff line number Diff line change @@ -127,7 +127,8 @@ extension AbstractDataSource: UITableViewDataSource {
127127 }
128128
129129 public func tableView( _ tableView: UITableView , heightForHeaderInSection section: Int ) -> CGFloat {
130- return header ( in: section) ? . height ?? CGFloat . leastNonzeroMagnitude
130+ let height = header ( in: section) ? . height
131+ return height. flatMap { CGFloat ( $0) } ?? CGFloat . leastNonzeroMagnitude
131132 }
132133
133134 public func tableView( _ tableView: UITableView , viewForFooterInSection section: Int ) -> UIView ? {
@@ -138,7 +139,8 @@ extension AbstractDataSource: UITableViewDataSource {
138139 }
139140
140141 public func tableView( _ tableView: UITableView , heightForFooterInSection section: Int ) -> CGFloat {
141- return footer ( in: section) ? . height ?? CGFloat . leastNonzeroMagnitude
142+ let height = footer ( in: section) ? . height
143+ return height. flatMap { CGFloat ( $0) } ?? CGFloat . leastNonzeroMagnitude
142144 }
143145}
144146
@@ -162,7 +164,7 @@ extension AbstractDataSource: UICollectionViewDataSource {
162164
163165extension AbstractDataSource : UITableViewDelegate {
164166 public func tableView( _ tableView: UITableView , heightForRowAt indexPath: IndexPath ) -> CGFloat {
165- return cellModel ( at: indexPath) . cellHeight
167+ return CGFloat ( cellModel ( at: indexPath) . cellHeight)
166168 }
167169
168170 public func tableView( _ tableView: UITableView , didSelectRowAt indexPath: IndexPath ) {
You can’t perform that action at this time.
0 commit comments