Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kkla320/gaugeprogressviewstyle

GaugeProgressViewStyle adds the Apple Watch gauge view to iOS.
https://github.com/kkla320/gaugeprogressviewstyle

ios swift swiftui

Last synced: 2 days ago
JSON representation

GaugeProgressViewStyle adds the Apple Watch gauge view to iOS.

Awesome Lists containing this project

README

        

![](logo.png)

[![Swift](https://github.com/kkla320/GaugeProgressViewStyle/actions/workflows/swift.yml/badge.svg?branch=develop&event=push)](https://github.com/kkla320/GaugeProgressViewStyle/actions/workflows/swift.yml) ![](https://img.shields.io/badge/Swift-5.5-orange) ![](https://img.shields.io/badge/spm-compatible-green)

GaugeProgressViewStyle adds the Apple Watch gauge view to iOS.

## Installation

To install GaugeProgressViewStyle, add GaugeProgressViewStyle as a dependency to your Package.swift file.

```swift
.package(url: "https://github.com/kkla320/GaugeView.git", from: "1.0.0")
```

## Usage

Simply use the `progressViewStyle` method of `ProgressView` and pass the GaugeProgressViewStyle via one of the static members named `gauge`.
Please have a look in the [wiki](https://github.com/kkla320/GaugeProgressViewStyle/wiki) for detailed documentation.

Code
Result

```swift
ProgressView(value: 0)
.progressViewStyle(.gauge())
```




![No parameters](Screenshots/sample_withoutParameters.png)

```swift
ProgressView(value: 0.5)
.progressViewStyle(.gauge(thickness: 20))
```




![Custom thickness](Screenshots/sample_withCustomThickness.png)

```swift
ProgressView(value: 0.5) {
Text("Gauge")
}
.progressViewStyle(.gauge())
```




![With label](Screenshots/sample_withLabel.png)

```swift
ProgressView(value: 0.5)
.progressViewStyle(
.gauge {
Text("12")
} upperLabel: {
Text("24")
}
)
```




![With upper lower labels](Screenshots/sample_withTextUpperAndLowerLabel.png)

```swift
ProgressView(value: 0.5)
.progressViewStyle(
.gauge {
Image(systemName: "sun.max.fill")
} upperLabel: {
Image(systemName: "cloud.rain.fill")
}
)
```




![With upper lower images](Screenshots/sample_withImageUpperAndLowerLabel.png)

## Requirements

- Swift 5.5
- iOS 14 and above

## Contributing

Simply create a pull request.