Cannot inherit from non-open class outside of its defining module
humblehacker opened this issue · 2 comments
humblehacker commented
The readme claims that it's possible to subclass my view model in Swift:
class TimeTravelViewModel: shared.TimeTravelViewModel {
... but when I try I get the error Cannot inherit from non-open class 'MyViewModel' outside of its defining module. Any advice?
rickclephas commented
Hi! In order to subclass the ViewModel in Swift you'll need to mark the Kotlin VM as open
:
open class TimeTravelViewModel: KMMViewModel()
humblehacker commented
🤦 Calling Kotlin from Swift has muddied my brain! Thanks and sorry for the noise.