Accessing Environment<Bool>'s value
[SwiftUI] Accessing Environment<Bool>'s value outside of being installed on a View. This will always read the default value and will not update.
@State private var value: Double = .zero
private var formatter: NumberFormatter {
let f = NumberFormatter()
f.numberStyle = .decimal
f.maximumFractionDigits = 20
return f
}
var body: some View {
SlidingRuler(value: $value,
in: 0...1,
step: 0.1,
snap: .fraction,
tick: .fraction,
formatter: formatter)
same +1
I made a fork and fixed this: https://github.com/Weixuanf/SlidingRuler
I just deleted accessing the environment .hasmark variable, it's kinda a hack now, let me know if there's a better to fix, I can do it
I made a fork and fixed this: https://github.com/Weixuanf/SlidingRuler
I just deleted accessing the environment .hasmark variable, it's kinda a hack now, let me know if there's a better to fix, I can do it
Thank you, solved the problem! <3