AnyCodable
AnyCodable copied to clipboard
Can use AnyCodable through PropertyWrapper
Hi~ First I'm happy for your great library. it makes our code more more simple and easy.
But I thinks AnyCodable has one problem.
When we use AnyCodable, we must implemented Codingkeys and Codable's many function 😱
This problem makes me write more codes. it's bad.
So I think good solution that is use PropertyWrapper. When we use PropertyWrapper, we don't have to write many codes. Just put it on to prefix.
This idea is inspired by KeyedCodable.CodedBy
class Example: Codable {
@CodedAnyArray var array: [Any]
@CodedIfPresentAnyDictionary var dict: [String: Any]?
}
Before merge this pull request, I have some problems to want to solve.
Problem
- I don't know "CodedAnyArray", "CodedAnyDictionary", "CodedIfPresentAnyArray", "CodedIfPresentAnyDictionary" is good name.
- "CodedIfPresentAnyArray", "CodedIfPresentAnyDictionary" isn't work in no json key. like this json "{}"