Can we implement pull to refresh feature on a custom view controller?. My view controller is not a table view controller and I want to refresh this view on pulling the screen down. How can I implement this feature?
In short, you need to do the following:
UIScrollView
.CGRectMake(0, -30, 320, 30)
for a 30pt-tall indicator view.–scrollViewDidScroll:
to update your "Pull to Refresh" view as the user is dragging.–scrollViewDidEndDragging:willDecelerate:
to check scrollView.contentOffset
when the dragging ends. If it's beyond your threshold for refreshing, then do the refresh.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With