Code: Select all
import SwiftUI
struct CurrentMonthView: View {
private var month: Month
@FetchRequest(
sortDescriptors: [SortDescriptor(\.date, order: .forward)],
predicate: NSPredicate(format: "month.identifier == %@", month.identifier), //❌
animation: .easeInOut
) var services: FetchedResults
init(month: Month) {
self.month = month
}
var body: some View {
ForEach(services) { service in }
}
}
< /code>
Das ❌ ist Folgendes: Das Instanzmitglied 'Month' in Property Initializer kann nicht verwendet werden; Immobilieninitialisierer, die vor 'Selbst' ausgeführt werden, ist verfügbar