Generate random images that include one pair

Hello code crew,

What I would like to be able to do is display six randomly generate images from an array(I have managed that much) and then generate a seventh random image from the six already displayed(that I can’t do) I think of it as like a raffle. Struggling to find advice on google. I welcome any advice. Thanks In advance!

so you have a list of 6 images already in your collectionview?

i suggest making 7 images from the start, but make the 7th image/data hidden (if indexpath = 6 then image.alpha = 0)

after that then probably add a logic like a button press to “load” your 7th image by setting the alpha to 1 then adding the random image to it

When you generate the 6 images from your array (of, presumably, more than 6 images), store them in a separate array. Then you can grab a randomElement() from the array of 6 images to display as a 7th image.

Thank you both very much for you’re help, my image is still not playing ball. I think I lack the skill set to achieve this right now. Could you perhaps sign post me to where I can learn/ get a better understanding. Thank you both again.

have you completed the match game from chris? that should put you on the right track

Ha yes I have. I think I will revisit it though thank you.