icerockdev / moko-mvvm

Model-View-ViewModel architecture components for mobile (android & ios) Kotlin Multiplatform development
https://moko.icerock.dev/
Apache License 2.0
994 stars 95 forks source link

Fix compiler error in Swift UI helpers when not using moko-resources #269

Open darronschall opened 2 months ago

darronschall commented 2 months ago

The StringDesc protocol comes from projects that also incorporate moko-resources. For projects that use only moko-mvvm, this code was generating a compiler error:

ViewModelStateNullable.swift:99:60: Cannot find type 'StringDesc' in scope

Note that this particular helper didn't have a corresponding state version in ViewModelState. After this change, both state and stateNullable are consistent in terms of the methods they offer.