Add the following to your Podfile
:
pod "SpringIndicator"
Add the following to your Cartfile
:
github "KyoheiG3/SpringIndicator"
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")
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
@IBInspectable var animating: Bool
drawRect
.@IBInspectable var lineWidth: CGFloat
@IBInspectable var lineColor: UIColor
gray
.var lineColors: [UIColor]
lineColor
is not used.@IBInspectable var lineCap: Bool
round
or square
. true is round
.false
.@IBInspectable var rotateDuration: Double
1.5
.let indicator: SpringIndicator
var isRefreshing: Bool
var isSpinning: Bool
true
.func start()
func stop(with: Bool = default, completion: ((SpringIndicator) -> Swift.Void)? = default)
func strokeRatio(_ ratio: CGFloat)
0.0
and 1.0
.func endRefreshing()
Follow me 🎉
Under the MIT license. See LICENSE file for details.
link |
Stars: 272 |
Last commit: 3 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics