'How can I do array mapping with response type [String]

My response is same this.

"speed" : [ "0" , "1" , "2"]

current when I use ObjectMapper I usual map same this.

var speed : [String] = []

func mapping(map: Map) {
        
        speed <- map["speed"]
        
}

then my map is return null data. how to map in this case.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source