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?
-Cappern
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?
-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:
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
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:
Thanks, I kinda found out on my own, but there sure was room for improvement
@cbaker6, keep up the good work!
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.