adwaita-swift/Sources/Core/View/ProgressBar+.swift
david-swift 8eeda083e9
All checks were successful
Deploy Docs / publish (push) Successful in 18m28s
SwiftLint / SwiftLint (push) Successful in 5s
Separate AnyView extensions from widgets
2024-10-16 14:22:34 +02:00

24 lines
458 B
Swift

//
// Progressbar+.swift
// Adwaita
//
// Created by david-swift on 15.01.24.
//
extension ProgressBar {
/// Initialize a progress bar widget.
/// - Parameters:
/// - value: The value.
/// - total: The maximum value.
public init(value: Double, total: Double) {
self.init()
if total != 0 {
self = self.fraction(value / total)
} else {
self = self.fraction(0)
}
}
}