How can I limit the size of the retrieved FetchedResults
when making a FetchRequest
to CoreData?
struct ContentView: View {
var fetchRequest:FetchRequest<Kana>
init(){
fetchRequest = FetchRequest<Kana>(entity: Kana.entity(), sortDescriptors: [], predicate: NSPredicate(format: "alphabet == %@", "hiragana"))
}
var body: some View {
List{
Text("10 Kanas")
// Display 10 Kanas
}
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…