Trivial approach: mutableCopy
the array of images, loop from 0 to 20, select an image (idx = arc4random_uniform(copiedArray.count);
) then remove the selected image from the dupe array.
(And no, don't use arc4random() % array.count
, modulus makes the randomness disappear, that's why there's the arc4random_uniform()
function.)