 	
 	@objc func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
 		selectionChanged?(indexPath.row)
+	}
+
+	func updateCachedHeights() {
+		cachedHeights.removeAll(keepCapacity: true)
+		for element in elements {
+			let node = element.assembleLayoutNode()
+			let layout = node.layout(maxWidth: tableView.frame.size.width)
+			cachedHeights[memoryAddress(element)] = layout.frame.size.height
+		}
 	}
 }
 

		
		return tableView
	}
	
	private final func layoutElements() {
		for element in elements {
			let node = element.assembleLayoutNode()
			let layout = node.layout(maxWidth: frame.size.width)
			element.applyLayout(layout)
		}
	}
}
import UIKit

private var ElementKey = "ElementKey"

private func memoryAddress(object: AnyObject) -> String {
	let ptr = Unmanaged<AnyObject>.passUnretained(object).toOpaque()
	return "\(ptr)"
}

private let defaultRowHeight: CGFloat = 42

