Quantcast
Channel: Check if a UIScrollView reached the top or bottom - Stack Overflow
Browsing latest articles
Browse All 7 View Live

Answer by Radu Ghitescu for Check if a UIScrollView reached the top or bottom

Do it like this(for Swift 3):class MyClass: UIScrollViewDelegate { func scrollViewDidScroll(_ scrollView: UIScrollView) { if (scrollView.contentOffset.y >= (scrollView.contentSize.height -...

View Article


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...

View Article

Answer by ytbryan for Check if a UIScrollView reached the top or bottom

If you want the code in swift: override func scrollViewDidScroll(scrollView: UIScrollView) { if (scrollView.contentOffset.y >= (scrollView.contentSize.height - scrollView.frame.size.height)) {...

View Article

Answer by JPN for Check if a UIScrollView reached the top or bottom

I figured out exactly how to do it:CGFloat maxPosition = scrollView.contentInset.top + scrollView.contentSize.height + scrollView.contentInset.bottom - scrollView.bounds.size.height;CGFloat...

View Article

Answer by Alexander Dvornikov for Check if a UIScrollView reached the top or...

Well, contentInsets are also involved, when you try to determine whether scrollView is at the top or at the bottom. You might also be interested in cases when your scrollView is above the top and below...

View Article


Answer by Luke for Check if a UIScrollView reached the top or bottom

Implement the UIScrollViewDelegate in your class, and then add this:-(void)scrollViewDidScroll: (UIScrollView*)scrollView{ float scrollViewHeight = scrollView.frame.size.height; float...

View Article

Check if a UIScrollView reached the top or bottom

Is there a way to know if a UIScrollView has reached the top or bottom? Possibly in the method:- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate

View Article
Browsing latest articles
Browse All 7 View Live




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