Sorry for the noob question but is there a way to use the "scroll to refresh" gesture as a button press?
Basically I have a simple app set up to demonstrate 1 aspect of a new project I am working on. Currently it is set to update some data based on a UIButton press, but I think it would be slick to do it with a swipe down gesture.
Everything I've been reading seems to show the default scroll to refresh / UIRefreshControl is only for UITableView elements.
Is there a way to us this type of gesture to emulate a button press?
You can try
SVPullToRefresh
which works on anyUIScrollView
subclass.If you want to implement it yourself, you can use key-value observing to observe the scrollView's
contentOffset
property or check it in thescrollViewDidScroll:
delegate method. From there, you can display the view you want above the scroll view's contents, and trigger whatever action you want based on the content offset.