The problem with arc4random () is that it does not generate numbers with the same probability.
I imagine you should be using arc4random () this way:
arc4random() % number;
Underneath the cloths, the arc4random () does not give the same numerical probability. There is a long discussion about this but nothing like looking at the documentation to understand the essentials:
arc4random_uniform() will return a uniformly distributed random number less than upper_bound.
arc4random_uniform() is recommended over constructions like ''arc4random() % upper_bound'' as it avoids
"modulo bias" when the upper bound is not a power of two.
That is, if you use arc4random_uniform, you have a better distribution.
In order not to repeat the last one, for security reasons, it is better to draw again if the previous number is the same as the draw.
I hope it helps.