[ad_1]
I am rewriting a view for an app that beforehand labored correctly and have been utilizing dummy knowledge to put out the view. At the moment I found that including a printed property from the @Atmosphere object that gives the information causes the view to freeze (or not less than the buttons to not work). That is complicated, because it beforehand labored.
The surroundings object is given to the app on the prime stage:
@essential
struct PowerCompareApp: App {
@StateObject var bt = Bluetooth()
var physique: some Scene {
WindowGroup {
ChartsPowerView()
.environmentObject(bt)
}
}
}
And used within the view that wants its knowledge:
struct ChartsPowerView: View {
@EnvironmentObject var bt: Bluetooth
Once I use the dummy knowledge, it really works. Once I add the @Printed properties type the @Atmosphere object, it stops:
// Dummy knowledge works
DataView(title: "Present", knowledge: 200.0)
DataView(title: "Common", knowledge: 200.0)
// Stops working with properties added
DataView(title: "Present", knowledge: bt.p1Power.watts)
DataView(title: "Common", knowledge: bt.p1Values.common)
Each the watts and common are initialized to zero when the app begins, so I do not suppose it is associated to that.
[ad_2]
