DEV Community

Discussion on: Progress bar in SwiftUI

Collapse
 
neverwintermoon profile image
Pavel Sorokin

I don't think you need to use @Binding for the value (@Binding var value: CGFloat). Bindings are used for two-way communication and you have one-way here. Just having let value: CGFloat would work the same.

Collapse
 
gualtierofr profile image
Gualtiero Frigerio

Correct.
Actually I don't remember why I used @Binding last summer but SwiftUI changed a lot during the beta, maybe I had problems back then with a simple var and used Binding, then I forgot to check and update the project. That's one of the caveats of rushing to adopt a new framework :)