I need to use the currentQuestion variable outside of the randomQuestionGenerator function. Whats the proper syntax for declaring it beforehand?
struct Questions {
var Question: String
var answer: Int
var answers: [String]
}
class GameScreen: UIViewController {
var correctAnswer = 0
var fullQuestions: [Questions] = []
func RandomQuestionGenerator(){
let randomQuestion =
Int(arc4random_uniform(UInt32(fullQuestions.count)))
var currentQuestion = fullQuestions[randomQuestion]
correctAnswer = currentQuestion.answer
currentQuestionsimilar tocorrectAnswer?