Hi and thanks for this amazing project, it has really helped me to implement a CoreData logic that fits my project!
Ive been doing some testing now and faced the following issue: As far as Im concerned, the SwiftUI List is nothing more than a UITableView under the hood. From my older projects where I used UIKit, I know that the UITableView fetches Data as the cells need them, so when I scroll and a new cell needs to appear, this entry is fetched by using the IndexPath of said cell, which also means that when the UITableView is first loaded, only the first 10 or so entries are fetched and displayed in the visible cells.
This was the behavior I expected with SwiftUI List as well, but what I've found is that entries are not fetched as the List needs them to be displayed. The FetchRequest is done right at the beginning, when the List is first displayed, fetching ALL of the entries. The cells are still only added to the list as needed (I checked using the "onAppear" function), but the data is there from the beginning. This results in the List loading extremely slow every time it is displayed fresh. Of course not when there are 10 objects, but I tried with 1000, which isn't that big, and the List then takes a full 4 seconds to load, leaving the UI completely unresponsive in that time.
Do you know if there is any way to get the old behavior back so the FetchRequest only fetches the objects that are currently visible in form of cells?
Hi and thanks for this amazing project, it has really helped me to implement a CoreData logic that fits my project!
Ive been doing some testing now and faced the following issue: As far as Im concerned, the SwiftUI List is nothing more than a UITableView under the hood. From my older projects where I used UIKit, I know that the UITableView fetches Data as the cells need them, so when I scroll and a new cell needs to appear, this entry is fetched by using the IndexPath of said cell, which also means that when the UITableView is first loaded, only the first 10 or so entries are fetched and displayed in the visible cells.
This was the behavior I expected with SwiftUI List as well, but what I've found is that entries are not fetched as the List needs them to be displayed. The FetchRequest is done right at the beginning, when the List is first displayed, fetching ALL of the entries. The cells are still only added to the list as needed (I checked using the "onAppear" function), but the data is there from the beginning. This results in the List loading extremely slow every time it is displayed fresh. Of course not when there are 10 objects, but I tried with 1000, which isn't that big, and the List then takes a full 4 seconds to load, leaving the UI completely unresponsive in that time.
Do you know if there is any way to get the old behavior back so the FetchRequest only fetches the objects that are currently visible in form of cells?