Post

Replies

Boosts

Views

Activity

Reply to Simple way to load json remotely from server?
I don't know of a specific tutorial but basically what you want to do is to define a model with these properties that is "Codable" (you can look this up - it will help you move back and forth between instances of the model and the JSON data) and then use URLSession to get data from the network and tell JSONDecoder to use your codable model to decode the data. The model specification and networking code is probably ~20 lines of code total, maybe less. Then you can use it with SwiftUI or in any other way needed.
Topic: App & System Services SubTopic: General Tags:
Jun ’22
Reply to Changing the live activity without push notification
No, you're not missing anything. This came up several times in the Slack-based Tech Talk chats too... Your choices are push notifications or background tasks. If you use background tasks you have very very little control over when they run. I eventually gave up and setup a very basic push system to do what I wanted and that works great. Basic push is pretty simple to do - I'd strongly recommend going down that road even if it's something where you really shouldn't need it.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’23