         return indexPath
     }
     
-    lazy var lastCellIntrinsicHeight: CGFloat = {
-        let lastCell: UITableViewCell
-        if let cell = self.tableView.cellForRow(at: self.lastCellIndexPath) {
-            // Already on screen or static table view controller
-            lastCell = cell
-        } else {
-            // Hasn't loaded yet in cellForRowAt, so load a copy
-            lastCell = self.tableView(self.tableView, cellForRowAt: self.lastCellIndexPath)
-        }
-        lastCell.layoutIfNeeded()
-        return lastCell.frame.height
-    } ()
-    
+	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
+	}()
+	
     // MARK: - Functions
-    
+	
     func indexPaths(toInsert cells: [UITableViewCell]) -> [IndexPath] {
         var indexPaths = [IndexPath]()
         for section in 0 ..< super.numberOfSections(in: tableView) {

    }
    
    // MARK: - UITableViewDelegate

    override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
        var height = intrinsicHeightCells
            ? UITableViewAutomaticDimension
            : super.tableView(tableView, heightForRowAt: superIndexPath(for: indexPath))
        if filledUsingLastCell && indexPath == lastCellIndexPath {
            let 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
            }
        }
        return height
    }
    
}


    @IBInspectable var filledUsingLastCell: Bool = false
    @IBInspectable var intrinsicHeightCells: Bool = false
	
	fileprivate var isDynamicLastCell: Bool = false
	fileprivate var dynamicLastCellHeight: CGFloat?
	
    /// Override in subclass, usually by connecting to an IBOutlet collection.
    var excludedCells: [UITableViewCell]? {
        return nil
