Check out example codes for "swift collection view check if you are at the bottom". It will help you in understanding the concepts better.

Code Example 1

func scrollViewDidScroll(_ scrollView: UIScrollView) {
    let height = scrollView.frame.size.height
    let contentYoffset = scrollView.contentOffset.y
    let distanceFromBottom = scrollView.contentSize.height - contentYoffset
    if distanceFromBottom < height {
        print(" you reached end of the table")

Learn ReactJs, React Native from