Custom animated pull-to-refresh that can be easily added to UIScrollView
PullToMakeSoup
Custom animated pull-to-refresh that can be easily added to UIScrollView.
Requirements
iOS 8.0+
Xcode 8
Swift 3
Portrait orientation
Carthage
github "Yalantis/PullToMakeSoup" ~> 2.0
Installing with CocoaPods
use_frameworks!
pod 'PullToMakeSoup', '~> 2.0'
Usage
At first, import PullToMakeSoup framework:
import PullToMakeSoup
Create refresher:
let refresher = PullToMakeSoup()
Add refresher to your UIScrollView subclass in 'viewDidAppear' method and provide action block:
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
tableView.addPullToRefresh(refresher) {
// action to be performed (pull data from some source)
}
}
After the action is completed and you want to hide the refresher:
tableView.endRefreshing()
You can also start refreshing programmatically:
tableView.startRefreshing()