I'm new to iOS development. If I include the lines
@Environment(\.managedObjectContext) var moc
@FetchRequest(sortDescriptors: [SortDescriptor(\.topic), SortDescriptor(\.id), SortDescriptor(\.tag)]) var facts: FetchedResults<Fact>
then the compile time is 115 seconds, but it is only 3 seconds if I comment them out. If I include only
@Environment(\.managedObjectContext) var moc
it is 10 seconds. (I’ve included images of “build with timing summary” below.) Any suggestions to improve this?
CodePudding user response:
I figured it out. I had too many sortDescriptors.