I have a fairly complicated ObservedObject with the following setup:
class ThreadDataStore: ObservableObject {
@Published var childCommentList: [Int]
@Published var childComments: [Int: CommentDataStore]
}
View: some View {
ForEach(threadDataStore.childCommentList, \.self) { id in
CommentView(comment: childComments[id]!)
}
}
When I have let's say 100-200 comments, then each loading becomes slower and slower.
Is the way I'm setting up my ObservableObjects not intended?
class ThreadDataStore: ObservableObject {
@Published var childCommentList: [Int]
@Published var childComments: [Int: CommentDataStore]
}
View: some View {
ForEach(threadDataStore.childCommentList, \.self) { id in
CommentView(comment: childComments[id]!)
}
}
When I have let's say 100-200 comments, then each loading becomes slower and slower.
Is the way I'm setting up my ObservableObjects not intended?