- August 28, 2025
- Mins Read
A custom animation for the UIRefreshControl. Inspired by this Dribble shot and this tutorial.
Install through CocoaPods
pod ‘GearRefreshControl’, ‘~> 1.0.0’
use_frameworks!
Setup your refreshControl
:
override func viewDidLoad() {
super.viewDidLoad()
gearRefreshControl = GearRefreshControl(frame: self.view.bounds)
gearRefreshControl.addTarget(self, action: #selector(ViewController.refresh), for: UIControlEvents.valueChanged)
self.refreshControl = gearRefreshControl
}
Update state:
override func scrollViewDidScroll(_ scrollView: UIScrollView) {
gearRefreshControl.scrollViewDidScroll(scrollView)
}
Stop the animation on completion:
self.gearRefreshControl.endRefreshing()
You can customize the color of the control by setting the gearTintColor
property:
gearRefreshControl.gearTintColor = .red
Checkout the sample project for the full implementation.
This package provides you with an easy way to show tooltips over any SwiftUI view, since Apple does not provide ...
SimpleToast is a simple, lightweight, flexible and easy to use library to show toasts / popup notifications inside iOS or ...
Create Toast Views with Minimal Effort in SwiftUI Using SSToastMessage. SSToastMessage enables you to effortlessly add toast notifications, alerts, and ...