From 1083d8643b936458cc45eb7829e14e32edfce809 Mon Sep 17 00:00:00 2001 From: Anton Martinsson Date: Sat, 25 Sep 2021 12:52:16 +0200 Subject: [PATCH] Adds a public init to the GaugeView struct. --- Sources/GaugeKit/GaugeView.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Sources/GaugeKit/GaugeView.swift b/Sources/GaugeKit/GaugeView.swift index 6ddffcb..20662f1 100644 --- a/Sources/GaugeKit/GaugeView.swift +++ b/Sources/GaugeKit/GaugeView.swift @@ -26,6 +26,16 @@ public struct GaugeView : View { public var colors: [Color] public var additionalInfo: GaugeAdditionalInfo? + public init(title: String? = nil, + value: Int? = nil, + colors: [Color], + additionalInfo: GaugeAdditionalInfo? = nil) { + self.title = title + self.value = value + self.colors = colors + self.additionalInfo = additionalInfo + } + public var body: some View { ZStack { ZStack {