The code you provided in the video cannot work. The 'Google' button you implemented in the UI has action 'signInWithGoogle' however you made that async later in the video and the code won't compile. Wrapping the action inside a Task is also a bad idea since you have UI code (accessing the root view controller) on a background thread. One way to fix this is to wrap the AuthViewModel in a @MainActor. This solves the issue but keep in mind this will block the UI once the code is waiting for the result from Firebase (since it's await).
@@danielwatson6529 Yeah my previous statement was actually wrong. It's perfectly good enough to just wrap the viewmodel class in a '@MainActor' and everything should be good to go. This property wrapper makes sure all UI updates are done on the main thread.
Hope you never stop this series! I'm very grateful! you are saving me a lot of time.
This is awesome! Thank you so much Peter!
The code you provided in the video cannot work. The 'Google' button you implemented in the UI has action 'signInWithGoogle' however you made that async later in the video and the code won't compile. Wrapping the action inside a Task is also a bad idea since you have UI code (accessing the root view controller) on a background thread. One way to fix this is to wrap the AuthViewModel in a @MainActor. This solves the issue but keep in mind this will block the UI once the code is waiting for the result from Firebase (since it's await).
did u come up with a solution? or did u implement another way
@@danielwatson6529 Yeah my previous statement was actually wrong. It's perfectly good enough to just wrap the viewmodel class in a '@MainActor' and everything should be good to go. This property wrapper makes sure all UI updates are done on the main thread.
Can you demonstrate how to log into MacOS using Google credentials?
Thank you....
This was amazing!
Thank you.
Nice video
very bad old better then now