add invalidate

This commit is contained in:
Max Sokolov 2016-06-15 21:23:41 +03:00
parent dd78ffa41e
commit 23378e2de4
1 changed files with 6 additions and 0 deletions

View File

@ -26,6 +26,8 @@ public protocol CellHeightCalculatable {
func height(row: Row, path: NSIndexPath) -> CGFloat
func estimatedHeight(row: Row, path: NSIndexPath) -> CGFloat
func invalidate()
}
public class PrototypeHeightStrategy: CellHeightCalculatable {
@ -63,4 +65,8 @@ public class PrototypeHeightStrategy: CellHeightCalculatable {
public func estimatedHeight(row: Row, path: NSIndexPath) -> CGFloat {
return UITableViewAutomaticDimension
}
public func invalidate() {
cachedHeights.removeAll()
}
}