In my list, my UIViewRepresentable won\'t be updated if it is the only item in list. If I add e.g. a Text to it, it works. To see the effect, scroll down and up again. What
For now I know variant/workaround that works (tested on all available Xcode 11.x)
var body: some View {
VStack {
List(data.names, id: \.self) { name in
Test(text: name).id(name) // << here !!
}
}
}
Note: it might be performance drop on very big lists, but in most usual cases it is not remarkable.
PS: By the way, about class Data
- don't name your classes with same names as system one, there might be confuses and unexpectable issues.