Flight-School / AnyCodable

Type-erased wrappers for Encodable, Decodable, and Codable values
https://flight.school/books/codable
MIT License
1.28k stars 132 forks source link

How to read value from Object #22

Closed amangupta001 closed 5 years ago

amangupta001 commented 5 years ago

Hi,

I have this struct struct Items : Codable { let id : Double? let custom_attributes : [Custom_attributes]? } struct Custom_attributes : Codable { let attribute_code : String? let value : AnyCodable }

Now let model = self.items?. custom_attributes[indexPath.row] Query: How to read value of mode.value in which datatype is dynamic

I can only read model.attribute_code but how I can read mode.value in which datatype is dynamic

mattt commented 5 years ago

Hi @amangupta001. We use GitHub Issues to track bugs and feature requests for this project. For general questions about Swift or Codable, please try asking on Stack Overflow or the like.