I need an ”AnyCodable" type for serialising some generic stuff.
Is something like this the best approach now that we have existentials on protocols?
@mattiem thanks for sharing! I did stumble across this, but wondered if Swift 5.7 could make all the casting/switching redundant.
@phill it may be able to! In my specific case, it mostly did. But the code I had to write was much simpler because I knew I was dealing with only JSON-compatible data types.
The home of The Not So Big Company on Mastodon.