Question/Problem, Everything is working fine from your tutorial but when I try to add anther string to the Task and add it everywhere the others are nothing shows up just says tasks not found and when take it away it works fine. Do you know if its possible to add more stuff to the task lite details etc?
@Mahadev-x7u Жыл бұрын
Amazing 🙌👏
@brandonb7362 Жыл бұрын
If anyone is having any issues with context.delete(object: task) you can just do context.delete(task)
@REYNALDO608111 ай бұрын
Awesome, thank you for this great video, can do you do a new video of example types menus please?,
@Etheriq2 Жыл бұрын
Hello, thank you for this great video, I have a question, how I can get the context in some service without @Environment(\.modelContext)?
@Kavsoft Жыл бұрын
guard let container = try? ModelContainer(for: Task.self) else { return } let ctx = ModelContext(container)
@sh3r1p496 ай бұрын
Hi how can I change the date. for example i want add a feature like "GO TO DATE" then it will paginate to a specific week? Thank you!
@sh3r1p496 ай бұрын
i made it.. by adding this on below .onAppear in Vstack.. .onChange(of: currentDate, { if !weekSlider.isEmpty { weekSlider.removeAll() print("currentDate Changed: \(currentDate)") let currentWeek = Date().fetchWeek(currentDate) if let firstDate = currentWeek.first?.date { weekSlider.append(firstDate.createPreviousWeek()) } weekSlider.append(currentWeek) if let lastDate = currentWeek.last?.date { weekSlider.append(lastDate.createNextWeek()) } print("currentDate Changed: \(weekSlider.count)") } })
@yurisidorov Жыл бұрын
Cannot get predicate work, as soon as I add `filter` to Query, all the UI disappears, no matter what predicate I insert there. And there is no error thrown. Is it a bug of Xcode 15 beta 5 or am I missing something?
@Baannia Жыл бұрын
Same
@Kavsoft Жыл бұрын
It’s actually a SwiftData bug, but it’s solved in Xcode 15 Beta 6. In Beta 5, mine too got frozen using the predicate, But on Beta 6, it’s running fine.
@MyFabricyo Жыл бұрын
Hi, great tutorial, but I couldn't make it run in my simulator, are you using an Apple Silicon Mac or an Intel one? Edit: Ignore it, it was the visual studio beta version, I was using the 5, but after downgrading to 4, it worked fine :)
@Ogrutsov Жыл бұрын
What If I have to support 15 version ios so how should I use swift data? If there back compatibility?
@Kavsoft Жыл бұрын
Actually, it’s not possible since SwiftData is only for iOS 17+.
@umarparacha653 Жыл бұрын
need more complex ui
@thealphazoid Жыл бұрын
Does anyone has problem wih this code - tasks are not appearing? meaning 'tasks.isEmpty'
@Kavsoft Жыл бұрын
I just tested the code, It’s working! Please verify whether you’ve added the model container in the Main App
@thealphazoid Жыл бұрын
@@Kavsoft weird, I got my code copied straight from Patreon
@Kavsoft Жыл бұрын
Is there any warning/error is displaying?
@MaxRovensky Жыл бұрын
Predicates are pretty useless right now I couldn't get them to work with outside variables despite the docs saying it's supported. My current approach to SwiftData is to get literally everything, unfiltered and unsorted from the query and do my sorting and filtering on the array