Well, after 12 hours all of a sudden it's decided to start executing the scheduled tasks. Not sure why but whatever, at least my code is good and I can then use appropriately knowing the limitations .
Post
Replies
Boosts
Views
Activity
I've already come across this post. The problem for me is a bit more binary like the app refresh task never runs ever in the background despite being scheduled. I can manually trigger it so I know the code is technically correct. I have this code all in an observable object. It should work but maybe all this functions I have need to be directly in the app delegate? Forget the 15 min I'd be happy if it ran once a day at this point.
It's not that. I've tried different time frames and it's not running at all in the background. BTW, much of my research out there on other forums says while timing is not predictable the refresh task code is expected to perform more frequently than the perform background task which is more to the timing you are talking about.
Where to look for and find the simulator.store?
See my response in this thread with the info you asked for
Took some digging around:
https://developer.apple.com/documentation/corelocation/adopting_live_updates_in_core_location
The first link is helpful. It makes reference to downloading a sample app but I can't seem to locate where that is? Can anyone share the link to what the video references?
Long story short is you have to make the model accessible across the app for both views and for swift access. While I was fine through views it was when I was trying to update the SwiftData via some functions that I ran into problems. Making the model container shared across the app solved the problem.
Looks like I'm going to have to go down this route with a background task [https://developer.apple.com/documentation/uikit/app_and_environment/scenes/preparing_your_ui_to_run_in_the_background/using_background_tasks_to_update_your_app)
Any suggestions or examples would be helpful.
Yes, on printing fetchDate2 I get my zero date fall back as fetchDate comes through there as nil. I'll try the sleep and see. I think that maybe something with using dispatchqueue in some way might be the answer but so far I've not had luck getting it to recognize the order of things between the function then the following code.
I went through a full file inspection and no files were pointing to ex-welcome-1 so somewhere out there Xcode is hanging on to an empty repository with no linked or referenced files. I renamed the ex-welcome-1 repository to ex-welcome-1-check and re opened the Zentastic project. No red unfound files came up. Then went on to
rename ex-welcome-1 repository on GitHub to ex-welcome-1-check and Xcode stopped bringing up the extra repository. I've solved the symptom but not the problem.
Nope just the one git repository. See screen shot. This is something Xcode is hanging on to or something else with GitHub
A practical example would help. I need to clear out the data in SectionsSD.self.
let container = try ModelContainer(for: [SectionsSD.self, ArticleSD.self])
let context = ModelContext(container)