current implementation is wrong:
public var indexPathForLastRow: IndexPath? {
guard numberOfRows > 0 else {
return nil
}
return IndexPath(row: numberOfRows - 1, section: lastSection)
}
it should be:
return IndexPath(row: indexPathForLastRow(in: lastSection), section: lastSection)
@muescha True, however the code is a bit repetitive and didn't work because an optional IndexPath being passed to method instead of row
return IndexPath(row: indexPathForLastRow(in: lastSection), section: lastSection)
I refactored the code to:
public var indexPathForLastRow: IndexPath? {
return indexPathForLastRow(inSection: lastSection)
}
Will change it in the next release, thank you!
yes - that is much shorter :)
Most helpful comment
@muescha True, however the code is a bit repetitive and didn't work because an optional IndexPath being passed to method instead of row
I refactored the code to:
Will change it in the next release, thank you!