Closed respan closed 8 years ago
Hey. I'm using Hakuba and so far it's great, but i think i found a bug. Cell's calculatedHeight property is always nil, even after all this calculations:
private extension CellModel { func calculateHeight() -> CGFloat { if let height = calculatedHeight { return height } guard let cell = delegate?.getOffscreenCell(reuseIdentifier) else { return estimatedHeight } cell.configureCell(self) let width = delegate?.tableViewWidth() ?? UIScreen.mainScreen().bounds.width cell.bounds = CGRectMake(0, 0, width, cell.bounds.height) cell.setNeedsLayout() cell.layoutIfNeeded() let size = cell.contentView.systemLayoutSizeFittingSize(UILayoutFittingCompressedSize) return size.height + 1 } }
I think you should set it to a value before returning from function.
@respan Great! Many thanks for your reporting. I have just fixed this bug and released a new version.
Hey. I'm using Hakuba and so far it's great, but i think i found a bug. Cell's calculatedHeight property is always nil, even after all this calculations:
I think you should set it to a value before returning from function.