I have this code:
import UIKit
class ViewController: UIViewController {
@IBAction func geraNumeros(_ sender: Any) {
var numeroAleatorio:[Int] = []
for _ in 1...6 {
numeroAleatorio.append(Int(arc4random_uniform(60)+1))
}
numeroAleatorio.sort()
labelNumeros.text = "\(numeroAleatorio[0]) - \(numeroAleatorio[1]) - \(numeroAleatorio[2]) - \(numeroAleatorio[3]) - \(numeroAleatorio[4]) - \(numeroAleatorio[5]) "
}
@IBOutlet weak var labelNumeros: UILabel!
}
But sometimes numbers repeating, like:
10 - 18 - 12 - 10 - 30 - 60
Like 10-10, so what to do?