We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed! a1a8fb1
onAppear mutating doesn't work correctly Text(person.name) .onAppear { person.name = "onAppear changed!" } limited by withObservationTracking's behavior, need takes some thinking. withObservationTracking { let _ = person.name person.name = "onAppear changed!" } onChange: { print("changed") // not called! }
onAppear mutating doesn't work correctly
Text(person.name) .onAppear { person.name = "onAppear changed!" }
limited by withObservationTracking's behavior, need takes some thinking.
withObservationTracking
withObservationTracking { let _ = person.name person.name = "onAppear changed!" } onChange: { print("changed") // not called! }
The text was updated successfully, but these errors were encountered:
我刚好遇到了一个类似的问题
这里不生效,是因为 onAppear 的 closure 是 escaping 的,将会被异步调用,不会被监听到。
我的问题是类似的,用到了 ForEach 这个类型,在 ForEach 的 closure 里面的 subview 访问 model 的属性 propertyA,subview 同样无法得到 propertyA 变更的刷新
Sorry, something went wrong.
No branches or pull requests
Fixed! a1a8fb1
The text was updated successfully, but these errors were encountered: