Swiftpack.co - kkla320/GaugeProgressViewStyle as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by kkla320.
kkla320/GaugeProgressViewStyle v1.0.0-beta.2
GaugeProgressViewStyle adds the Apple Watch gauge view to iOS.
⭐️ 29
🕓 1 year ago
iOS macOS tvOS macCatalyst
.package(url: "https://github.com/kkla320/GaugeProgressViewStyle.git", from: "v1.0.0-beta.2")

Swift

GaugeProgressViewStyle adds the Apple Watch gauge view to iOS.

Installation

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

.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 for detailed documentation.

Code Result
ProgressView(value: 0)
  .progressViewStyle(.gauge())

No parameters

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

Custom thickness

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

With label

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

With upper lower labels

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

With upper lower images

Requirements

  • Swift 5.5
  • iOS 14 and above

Contributing

Simply create a pull request.

GitHub

link
Stars: 29
Last commit: 18 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Dependencies

Release Notes

1.0.2
18 weeks ago
  • Fixed a compile error (#10)

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics