Closed adnanatflo closed 5 years ago
I really don't see what you are trying to achieve. If you have a Dictionary<String, Point>
and if you call values
on it and convert it into Array(values)
you already do have what you are trying to decode without actually decoding it.
If you test Array(value.values) is [Point]
that should print true and that's even before decoding to the type you want.
Maybe I misunderstood your problem or your point if you can provide a minimum testable problem that we can reproduce in a playground or project we can help more.
This my Struct :
struct Goal : Codable { var goalnotes : String? var link : String? var name : String? var tags : String? var target_points : Int? var total_points : Int? var youtube : String? var point_items : [String: Point]? }
struct Point : Codable { var points : Int? var userNotes : String? }
I have successfully decode "Goal" modal but i cant decode "point_items" to array. This is my code for decoding "point_items". please help me to fix this problem.
Help would be much appreciated.