mardi 15 novembre 2016

arc4random Swift 3 syntax

I made a quiz app in Swift 2 I'm trying to update the syntax from random to arc4random...

if Questions.count > 0 && counter <= 15 {
            QNumber = arc4random()% Questions.count
            QLabel.text = Questions[QNumber].Question

        AnswerNumber = Questions[QNumber].Answer

        for i in 0..<Buttons.count{
            Buttons[i].setTitle(Questions[QNumber].Answers[i], for: UIControlState())
        }
        Questions.remove(at: QNumber)
    }




Aucun commentaire:

Enregistrer un commentaire