SSCustomPullToRefresh is an open-source library that uses UIKit to add an animation to the pull to refresh view in a UITableView and UICollectionView.
SSCustomPullToRefresh is an open-source library that uses UIKit to add an animation to the pull to refresh view in a UITableView and UICollectionView.
Spinner Animation | Pulse Animation | Wave Animation | Wave Animation |
---|---|---|---|
You can use CocoaPods to install SSCustomPullToRefresh by adding it to your Podfile:
use_frameworks!
pod 'SSCustomPullToRefresh'
import SSCustomPullToRefresh
SSCustomPullToRefresh
by going to your Project settings > Swift Packages
and add the repository by providing the GitHub URL. Alternatively, you can go to File
> Swift Packages
> Add Package Dependencies...
dependencies: [
.package(url: "https://github.com/mobile-simformsolutions/SSCustomPullToRefresh.git", from: "1.0.1")
]
$ brew update
$ brew install carthage
To integrate SSCustomPullToRefresh
into your Xcode project using Carthage, add the following line to your Cartfile
:
github "mobile-simformsolutions/SSCustomPullToRefresh"
Run carthage
to build and drag the SSCustomPullToRefresh
(Sources/SSCustomPullToRefresh) into your Xcode project.
SpinnerAnimationView takes image and backgroundColor as an input parameter. You can provide it as per your choice.
spinnerAnnimation = SpinnerAnimationView(image: UIImage(named: "spinner"), backgroundColor: .purple)
spinnerAnnimation.delegate = self
spinnerAnnimation.parentView = self.tableView
spinnerAnnimation.setupRefreshControl()
SineWaveAnimationView takes Color as an input parameter.
sineAnnimation = SineWaveAnimationView(color: .purple)
sineAnnimation.delegate = self
sineAnnimation.parentView = self.tableView
sineAnnimation.setupRefreshControl()
Along with this, you can also provide two different colors and a waveHeight value. You can give a waveHeight value between 5.0 to 50.0.
sineAnnimation = SineWaveAnimationView(frontColor: .orange, backColor: .purple, waveHeight: 10.0)
PulseAnimationView takes Color as an input parameter. You can provide center circle color, pulse color and background color of your refresh view.
pulseAnnimation = PulseAnimationView(circleColor: .purple, pulseColor: .purple,
pulseViewBackgroundColor: .brown)
pulseAnnimation.delegate = self
pulseAnnimation.parentView = self.tableView
pulseAnnimation.setupRefreshControl()
The RefreshDelegate
methods can be used to notify start and end refresh.
extension ViewController: RefreshDelegate {
func startRefresh() { }
func endRefresh() { }
}