Parse-Swift example for SwiftUI App life cycle

Hi, beeing a total noob in swift programming I find it hard to implement Parse-swift with the “new” SwiftUI app life cycle.
Does anyone care to share any examples to get my project started? :nerd_face:

-Cappern

Hey @cappern!
I just created an Github project with Parse in SwiftUI. Very simple stuff: only configures Parse and in the ContentView it makes a simple query printing stuff on the onAppear event.
Hope it helps you.
Here is the link for it:

1 Like

If you are referring to the recently released Parse-Swift SDK. This project uses it

To see how you would implement a login screen in SwiftUI you can look at these files:

Parse-Swift will receive some additional updates soon to make it easier to use with Parse-Swift. For now, you can look at the last file I posted to see how to add Parse-Swift to a view model

1 Like

There’s currently a pending PR on Parse-Swift that makes the SDK directly functional with SwiftUI, reducing the need to make custom view models for api calls to a Parse Server. The ParseLiveQuery part of Parse-Swift has it’s own view model (Subscription) that can already keep your SwiftUI views up-to-date. The PR is below:

2 Likes

Thanks, I kinda found out on my own, but there sure was room for improvement :smiley:
@cbaker6, keep up the good work! :ok_hand:

1 Like

Version 1.1.3 has publisher support:

Check the documentation for information about the Publishers (look for “Combine” or “Publisher”).

The previous versions still support SwiftUI, you would just use sync/async calls in your view model instead of using “…Publisher” like in my previous links.

1 Like