bukira
2
Is there a way to make this work with large data sets?
Below creates 1000 records and the app becomes sluggish and slow to respond, is this a flaw in SwiftUi?
private func addTestFriends() {
let request = Friend.fetchRequest()
let context = PersistenceManager.shared.persistentContainer.viewContext
do {
if try context.count(for: request) == 0 {
for number in 1...1000 {
print(number)
try Friend.generateTestFriends(in: context)
}
}
} catch {
print("Error generating friends: \(error)")
}
}
Hi. Do you mean it becomes sluggish while the load is happening or for the entire time after you add the records?