implement dynamic type for master feed list

This commit is contained in:
Maurice Parker
2019-04-28 10:31:35 -05:00
parent 5fc3fee12d
commit d7391b208d
8 changed files with 140 additions and 66 deletions

View File

@@ -243,14 +243,3 @@ private extension MasterTimelineCellLayout {
return r
}
}
private extension Array where Element == CGRect {
func maxY() -> CGFloat {
var y: CGFloat = 0.0
self.forEach { y = Swift.max(y, $0.maxY) }
return y
}
}

View File

@@ -98,9 +98,12 @@ private extension MultilineUILabelSizer {
}
var height = MultilineUILabelSizer.calculateHeight(string, width, font)
let maxHeight = singleLineHeightEstimate * numberOfLines
if height > maxHeight {
height = maxHeight
if numberOfLines != 0 {
let maxHeight = singleLineHeightEstimate * numberOfLines
if height > maxHeight {
height = maxHeight
}
}
cache[string]![width] = height