How to update a single child view in SwiftUI?

前端 未结 3 382
一向
一向 2021-02-06 17:01

I am trying to establish a SwiftUI connection between the child view and the parent view. By clicking on any child view, I want to redraw only the view that has been tapped, not

3条回答
  •  我在风中等你
    2021-02-06 17:37

    At now there is no possibility to update specific child view and it cannot be expected I think. As was told on Data flow Through Swift UI session once you are changing @State property or Bindable object - all the changes flow down through view hierarchy and SwiftUI framework is comparing all the views and rendering again only what has changed.

提交回复
热议问题