Closed jollygreenegiant closed 6 months ago
Create extension in swift to generated enum with required protocol
@Alex009 could you elaborate on that a little bit? I'm a Kotlin developer by trade, not Swift, so I'm not super familiar with what that might look like
@jollygreenegiant you can declare your own extension in your code
extension BookTypeKs: Codable, Hashable {
...
}
I have the following Swift code:
and
BookTypeKs
is generated like this:The Kotlin class is defined like this:
I'm getting the error
Type 'HomeDestination' does not conform to protocol 'Codable/Decodable/Equatable/Hashable'
Is there a way to get Moko to generate enum classes that do conform to those protocols? Or at least a simple way to manually make them conform?
My Swift skills aren't particularly strong, and this is something I've run into multiple times now working in KMM and would love to know how to fix for the future.