I have an array called [images]. Within this array, there is the ID of each image, and the URL of each image. I wish to put only the URL (not the ID) of the selected image into a variable to be used elsewhere.
For example, when I print my entire array:
print(images)
I get the following:
[(id: "nni", URL: "https://bbc.com/a1.jpg"), (id: "9hr", URL: "https://bbc.com/a2.jpg")]
I am able to successfully isolate the selected image using the following
print(images[indexPath.row)
So, if I click on the first image, this print statement will return:
[(id: "nni", URL: "https://bbc.com/a1.jpg")] // This is correct
However, I ONLY want to isolate that URL, and put it into a new variable, selectedURL
selectedURL = "https://bbc.com/a1.jpg"
How can I do this?