jeudi 16 juillet 2020

How to generate a random image in Swift without repeating the previous random images?

Here´s my codes so far:

@IBAction func nesteTapped(_ sender: Any) {

    // Random Jeg Har Aldri
    let jegHaraldri = Int.random(in: 1...5)
    
    
    // Update the image view
    spørsmålView.image = UIImage(named: "jeg\(jegHaraldri)")
    
}



Aucun commentaire:

Enregistrer un commentaire