Closed EventfulG closed 6 years ago
After more digging I found the solution here https://stackoverflow.com/questions/51423153/how-to-get-value-and-id-value-for-pushrow-in-swift4
Yes but this solution will not work for for self.form.values() as constructed Dictionary will contain full object, not just an ID
I use xCode 9, swift 4 and "Eureka form library" for my project.
The situation
I have a list of cars with name and unique ID associated this way: 0 - ANY, 1 - VW, 7 - AUDI, 20 - MAZDA
var name_cars: [String] = ["ANY","VW","AUDI","MAZDA"]
var id_cars:[Int] = [0, 1, 7, 20]
I also have a form with "PushRow" and "ButtonRow". On click to the button I want to print the selected car name and ID. I was able to print the car's name but not the ID.