You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got dynamic coding with a protocol working but I'd rather not use that. It seems it only works with protocols and enums?
@robaho I am assuming you are talking about MetaProtocolCodable, you can use enums without having to use the MetaProtocolCodable. MetaCodable by itself provides untagged, external, internal and adjacent tagging enum decoding functionality. For your use case, it could look something like:
@Codable
struct Container
let elements: [AOrB]
@Codable
@UnTagged
enum AOrB {
case b(name: String, location : String)
case a(name: String)
}
}
Please use discussion to ask these kind of queries. And use the proper templates when creating issues.
Activity
soumyamahunt commentedon Oct 25, 2024
@robaho I am assuming you are talking about
MetaProtocolCodable, you can use enums without having to use theMetaProtocolCodable.MetaCodableby itself provides untagged, external, internal and adjacent tagging enum decoding functionality. For your use case, it could look something like:Please use discussion to ask these kind of queries. And use the proper templates when creating issues.
[-][Bug] simple inheritance [/-][+]simple inheritance [/+]