Closed jollygreenegiant closed 9 months ago
Hi! KMP-NativeCoroutines generates extensions properties (and functions) so it is to be expected that those don't show up in the SharedHomeViewModel
class. However there should be a state
property in a SharedHomeViewModel
category.
In your example the following Swift code should work:
let viewModel = HomeViewModel()
let state: HomeScreenState = viewModel.state
If that isn't the case I can think of a couple possible causes:
_
s to some of the names. In that case you'll see a state_
property on your VM instead of the expected state
Okay sweet, got it building - KSP wasn't applied properly and I had to update from 1.9.21-1.0.16
to 1.9.22-1.0.16
. Thank you!
KMP-Coroutines version 1.0.0-ALPHA-24 KMM-ViewModel version 1.0.0-ALPHA-17
I have a ViewModel defined in my shared layer as follows:
The generated class in Xcode looks like this:
You can see that the
state
property isn't there - I'm assuming that I'm just missing something here, how can I get access to that property in Swift?