I have a List View with pagination inside a NavigationView and everything is working great on iOS 15 but I am having an issue on iOS 16. It appears that the onAppear on the ItemRowView isn't being called when some rows appear in the list. I use the onAppear of the row to detect if the row is the last and fetch additional records from the REST api.
I am not sure what I am doing wrong.
If I comment out the NavigationLink I do not get the issue.
I have tried rewriting it using NavigationStack and I get the same exact issue.
struct ListWithPagingView: View {
@StateObject var dataSource = ContentDataSource()
var body: some View {
NavigationView {
List {
ForEach(dataSource.items) { item in
NavigationLink(destination: ItemDetails(item: item)) {
ItemRowView(item: item)
.onAppear {
viewModel.onAppear(item: item)
}
}
}
}
}
}
}