ViewStore is publishing changes from within view updates #1319
StefanCosminR
started this conversation in
General
Replies: 2 comments 6 replies
-
Here is a sample project |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @StephenCosimo, this seems to be a regression in iOS 16 and/or Xcode 14. The equivalent vanilla SwiftUI version of your demo also reproduces the problem: import SwiftUI
class Model: ObservableObject {
@Published var number = 0
func increment() {
self.number += 1
}
}
struct ContentView: View {
@StateObject var model = Model()
var body: some View {
Form {
Button {
self.model.increment()
} label: {
Text("Increment")
}
}
}
} I'm going to move this to a discussion since it is not a problem with the library per se, but if anyone has any ideas of what the heck is going on with this I'd love to know! |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I am not sure if this is an Xcode issue because I don't remember seeing this in the past. Reproducing this is very easy, as you can see in the following screenshot. Sending any action using the ViewStore results in this kind of warning.
Checklist
main
branch of this package.Expected behavior
No response
Actual behavior
No response
Steps to reproduce
No response
The Composable Architecture version information
main, protocol-beta, 0.39.1
Destination operating system
iOS 16
Xcode version information
Version 14.0 beta 6 (14A5294g)
Swift Compiler version information
Beta Was this translation helpful? Give feedback.
All reactions