ParseLiveQuery SwiftUI Example?

Does anybody know how to subscribe to objects and list in a List? Looked at the test and tried to use query.subscribe! but nothing.

Can you show your code? The test cases don’t use SwiftUI, so you can’t use those directly, but a subscription should be able to work directly with a SwiftUI view or inside your own view model.

This is how you use a live query subscription as a view model for SwiftUI via Playgrounds. The rest of the publishers (ParseUser.signup, login, save, etc.) in ParseSwift are used in a similar way

1 Like

No code.

Thanks. How do you put this in a List and update without a controller? Any chance you’ve got an example?

The code above shows how to use LiveQuery to subscribe to events on any ParseObject and use them to update any SwiftUI view. You should be able to take that object and display it anyway you want as SwiftUI probably has infinite ways to use it. Your question,

How do you put this in a List and update without a controller?

is a “how to program in SwiftUI” question, in which there are a ton of resources online that go into detail on how to do this. Here’s one for list and another.

In your original question:

Does anybody know how to subscribe to objects and list in a List? Looked at the test and tried to use query.subscribe! but nothing.

You mentioned you “tried”. If you provide the code you tried, it’s easier to answer your question.