Returning `nan`
petomuro opened this issue · 1 comments
petomuro commented
This line of code in some situations returns nan
instead of 0
which is not good. I suggest add a condition like:
private func getCollapseProgress() -> CGFloat {
let result = 1 - min(max((getHeightForHeaderView() - minHeight) / (maxHeight - minHeight), 0), 1)
if result.isNaN {
return 0
} else {
return result
}
}
or some another solution.
I haven't studied the code in depth but there is probably division by zero in some situation.