I'm facing a problem when I have to update the interface when the property marked with the native @AppStorage property wrapper changes and UI-related code wrapped within WithPerceptionTracking {} view. But it doesn't respond. UI updates only when another source triggers a reload view.
Here is an example:
struct SomeView: View {
@Perception.Bindable var store: StoreOf<SomeState>
@AppStorage("tapCount")
private var tapCount = 0
var body: some View {
WithPerceptionTracking {
Button("Tap count: \(tapCount)") {
tapCount += 1
}
}
}
}
If replace @AppStorage("tapCount") with @State it works. Only I have to use persistence
If remove WithPerceptionTracking {} also works, but WithPerceptionTracking error comes out.
Checklist
[ ] I have determined whether this bug is also reproducible in a vanilla SwiftUI project.
[X] If possible, I've reproduced the issue using the main branch of this package.
Description
I'm facing a problem when I have to update the interface when the property marked with the native
@AppStorage
property wrapper changes and UI-related code wrapped withinWithPerceptionTracking {}
view. But it doesn't respond. UI updates only when another source triggers a reload view.Here is an example:
@AppStorage("tapCount")
with@State
it works. Only I have to use persistenceWithPerceptionTracking {}
also works, but WithPerceptionTracking error comes out.Checklist
main
branch of this package.Expected behavior
No response
Actual behavior
No response
Steps to reproduce
No response
The Composable Architecture version information
1.11.2
Destination operating system
iOS 15
Xcode version information
Version 15.4 (15F31d)
Swift Compiler version information