Quantcast
Viewing latest article 2
Browse Latest Browse All 7

Answer by Rudolf Adamkovič for Check if a UIScrollView reached the top or bottom

Simple and clean extension:

import UIKitextension UIScrollView {    var scrolledToTop: Bool {        let topEdge = 0 - contentInset.top        return contentOffset.y <= topEdge    }    var scrolledToBottom: Bool {        let bottomEdge = contentSize.height + contentInset.bottom - bounds.height        return contentOffset.y >= bottomEdge    }}

On GitHub:

https://github.com/salutis/swift-scroll-view-edges


Viewing latest article 2
Browse Latest Browse All 7

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>