GearRefreshControl
  • September 24, 2023

A custom animation for the UIRefreshControl. Inspired by this Dribble shot and this tutorial.

Screenshot


Usage


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()

Customization


You can customize the color of the control by setting the gearTintColor property:

gearRefreshControl.gearTintColor = .red

Checkout the sample project for the full implementation.

GitHub


View Github

YOU MIGHT ALSO LIKE...
exyte

     

camerakit-ios

CameraKit helps you add reliable camera to your app quickly. Our open source camera platform provides consistent capture results, service ...

HybridCamera

[video width="192" height="416" mp4="https://swiftgit.com/wp-content/uploads/2024/12/68747470733a2f2f7261776769742e636f6d2f7374796c656b69742f696d672f6d61737465722f7669645f6564697465645f325f326d622e676966.mp4"][/video]

TakeASelfie

An iOS framework that uses the front camera, detects your face and takes a selfie. This api opens the front ...

iOS-Depth-Sampler

Code examples of Depth APIs in iOS