I have a dictionary in swift as seen here:
var pictures: [String:Int] = ["http://i.imgur.com/3VGLzoI.jpg":0, "http://i.imgur.com/wATPxvQ.png":0, "http://i.imgur.com/Q2XlngY.png":0]
Is there any way to increment or decrement the integer? If not, would a multidimensional array be a better option. I basically need the "vote" (integer) to stick with the link.
I think you could do:
pictures["yourKey"]? += 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With