Home

Awesome

SpringIndicator

Carthage compatible Version License Platform

Appetize's Demo

Indicator Refresher

Image

Requirements

How to Install SpringIndicator

Cocoapods

Add the following to your Podfile:

pod "SpringIndicator"

Carthage

Add the following to your Cartfile:

github "KyoheiG3/SpringIndicator"

Swift Package Manager

To install BulletinBoard using the Swift Package Manager, add this dependency to your Package.swift file:

.package(url: "https://github.com/KyoheiG3/SpringIndicator.git", from: "5.1.0")

Usage

Example

Add Code

let indicator = SpringIndicator(frame: CGRect(x: 100, y: 100, width: 60, height: 60))
view.addSubview(indicator)
indicator.start()

RefreshIndicator

let refreshControl = RefreshIndicator()
refreshControl.addTarget(self, action: "onRefresh", forControlEvents: .ValueChanged)
scrollView.addSubview(refreshControl)

Exit refresh

refreshControl.endRefreshing()

Can use Interface Builder

Interface Builder

Variable

Indicator

@IBInspectable var animating: Bool
@IBInspectable var lineWidth: CGFloat
@IBInspectable var lineColor: UIColor
var lineColors: [UIColor]
@IBInspectable var lineCap: Bool
@IBInspectable var rotateDuration: Double

RefreshIndicator

let indicator: SpringIndicator
var isRefreshing: Bool

Function

Indicator

var isSpinning: Bool
func start()
func stop(with: Bool = default, completion: ((SpringIndicator) -> Swift.Void)? = default)
func strokeRatio(_ ratio: CGFloat)

Refresher

func endRefreshing()

Author

Kyohei Ito

Follow me 🎉

LICENSE

Under the MIT license. See LICENSE file for details.