Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ilyapuchka/gauges
Gauges gives you a nice looking circular progress view.
https://github.com/ilyapuchka/gauges
Last synced: 15 days ago
JSON representation
Gauges gives you a nice looking circular progress view.
- Host: GitHub
- URL: https://github.com/ilyapuchka/gauges
- Owner: ilyapuchka
- License: mit
- Created: 2018-01-02T15:33:58.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-09T13:26:50.000Z (almost 7 years ago)
- Last Synced: 2025-01-13T15:24:03.891Z (17 days ago)
- Language: Swift
- Size: 145 KB
- Stars: 88
- Watchers: 5
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gauges
Gauges gives you a nice looking circular progress view.![](https://github.com/ilyapuchka/Gauges/blob/master/example.png)
### Usage
You can customize almost every visual aspect of the view using `Gauge` struct .
```swift
struct Gauge {
enum Color {
case gradient([(color: UIColor, location: CGFloat)])
case solid(UIColor)
}enum Direction {
case clockwise
case counterClockwise
}var value: Float
var color: Color
var radius: CGFloat
var lineWidth: CGFloat
var backgroundColor: Color
var direction: Direction
var startAngle: CGFloat}
gaugeView.gauges = [
Gauge(value: 0, color: .gradient([(.yellow, 0), (.orange, 1)]), radius: 60, lineWidth: 15),
Gauge(value: 0, color: .gradient([(.cyan, 0), (.green, 1)]), radius: 90, lineWidth: 15),
Gauge(value: 0, color: .gradient([(.blue, 0), (.magenta, 1)]), radius: 120, lineWidth: 15)
]
```Additionally you can customize shadows with `Shadow` struct:
```swift
struct Shadow {
enum Color {
case colors([UIColor])
case blur
}var color: Color
var offset: CGSize
var opacity: CGFloat
var radius: CGFloat
}gaugeView.shadow = Shadow(color: .blur)
```You can access and change values of each gauge individually:
```swift
gaugeView.gauges[0].value = 0.5
```### Limitations
`UIVisualEffectView` was used for gradient shadow, which comes with some limitations:
- everything that you put behind `GagueView` will be blurred, to avoid that set it an opaque background color
- you can not change shadow radius after it was set for the first time when you use `.blur` shadow color
- you may notice some color artifacts on the edges of `GaugeView` even if you use solid background color
### Used by
[Aconta: income and expenses](https://itunes.apple.com/us/app/aconta-income-and-expenses/id1301129130?ls=1&mt=8)