     @IBInspectable open var intrinsicHeightCells: Bool = false
     
     fileprivate var isDynamicLastCell: Bool = false
-    fileprivate var needRefreshDynamicLastCellHeight: Bool = false
+    fileprivate var needRefreshDynamicLastCellHeight: Bool = true
     fileprivate var dynamicLastCellHeight: CGFloat?
     fileprivate var previousRowFrame = CGRect()
     

    lazy var lastCellIntrinsicHeight: CGFloat = {
        var height = self.tableView.estimatedRowHeight
        if let cell = self.tableView.cellForRow(at: self.lastCellIndexPath) {
            // Already on screen or static table view controller
            cell.layoutIfNeeded()
            height = cell.frame.height
        } else {
            // Hasn't loaded yet in cellForRowAt, calculate height after tableView is fully loaded
            self.isDynamicLastCell = true
        }
        return height

                if let dynamicLastCellHeight = self.dynamicLastCellHeight {
                    height = dynamicLastCellHeight
                    let currentPreviousRowFrame = tableView.rectForRow(at: IndexPath(row: indexPath.row - 1, section: indexPath.section))
                    // Detect changes on tableView contents after dynamicLastCellHeight is set.
                    if currentPreviousRowFrame.maxY != previousRowFrame.maxY {
                        refreshDynamicLastCellHeight()
                    }
                }
            } else {
                previousRowFrame = tableView.rectForRow(at: IndexPath(row: indexPath.row - 1, section: indexPath.section))
                // Get height of empty spaces to fill.
                let availableHeight = tableView.frame.size.height - previousRowFrame.maxY
                if availableHeight > lastCellIntrinsicHeight {
                    height = availableHeight
