# ParseLiveQuery SwiftUI Example?

**URL:** <https://community.parseplatform.org/t/parselivequery-swiftui-example/1283>\
**Category:** ParseSwift SDK\
**Tags:** swift-ui, live-query\
**Created:** [February 5, 2021, 5:05am UTC](https://community.parseplatform.org/t/parselivequery-swiftui-example/1283 "2021-02-05T05:05:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bgo](https://community.parseplatform.org/letter_avatar_proxy/v4/letter/b/848f3c/32.png) [@bgo](https://community.parseplatform.org/u/bgo)\
**Post date:** [February 5, 2021, 5:05am UTC](https://community.parseplatform.org/t/parselivequery-swiftui-example/1283/1 "2021-02-05T05:05:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cbaker6](https://community.parseplatform.org/user_avatar/community.parseplatform.org/cbaker6/32/114_2.png) [@cbaker6](https://community.parseplatform.org/u/cbaker6)\
**Post date:** [February 5, 2021, 3:08pm UTC](https://community.parseplatform.org/t/parselivequery-swiftui-example/1283/2 "2021-02-05T15:08:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cbaker6](https://community.parseplatform.org/user_avatar/community.parseplatform.org/cbaker6/32/114_2.png) [@cbaker6](https://community.parseplatform.org/u/cbaker6)\
**Post date:** [February 5, 2021, 5:20pm UTC](https://community.parseplatform.org/t/parselivequery-swiftui-example/1283/3 "2021-02-05T17:20:35Z")

</div>

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

> <https://github.com/parse-community/Parse-Swift/blob/87c6adf32ea012fd8d3fd541f7b08967ad8b619c/ParseSwift.playground/Pages/11%20-%20LiveQuery.xcplaygroundpage/Contents.swift#L33-L86>

---

<div class="post-metadata">

**Author:** ![bgo](https://community.parseplatform.org/letter_avatar_proxy/v4/letter/b/848f3c/32.png) [@bgo](https://community.parseplatform.org/u/bgo)\
**Post date:** [February 6, 2021, 8:25am UTC](https://community.parseplatform.org/t/parselivequery-swiftui-example/1283/4 "2021-02-06T08:25:44Z")

</div>

No code.

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

---

<div class="post-metadata">

**Author:** ![cbaker6](https://community.parseplatform.org/user_avatar/community.parseplatform.org/cbaker6/32/114_2.png) [@cbaker6](https://community.parseplatform.org/u/cbaker6)\
**Post date:** [February 6, 2021, 2:06pm UTC](https://community.parseplatform.org/t/parselivequery-swiftui-example/1283/5 "2021-02-06T14:06:02Z")

</div>

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](https://www.hackingwithswift.com/quick-start/swiftui/building-a-menu-using-list) for list and [another](https://developer.apple.com/tutorials/swiftui/building-lists-and-navigation).

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.
