Post

Replies

Boosts

Views

Activity

Comment on How is my variable holding two different objects when it's not an array?
Hey, thanks for your comment. I ended up figuring out the issue. The JSON data wasn't being loaded completely before the app checked the date. So I moved the code from the onAppear to this part. DispatchQueue.main.async { self?.user = user self?.user.checkDate() } In regards to the issue with it printing June and July, it was because the view was being refreshed so the code to print ran twice. It printed before the JSON data was loaded, and then after it was loaded.
Jun ’21
Comment on Weird issue with SwiftData saving models correctly, but causing a crash when trying to access data prior to the saving
It's such a weird issue. I would think if you can't access the object prior to inserting it, then it would also crash when you insert it. I ended up inserting the Request into the context, and then filtering after, but it won't update the view properly. I have to close and reopen the app. Even if I attach an ID to the view and change it, so it forces the view to redraw, it still doesn't update the view properly.
Oct ’23