2
Good afternoon guys all right?
how do I pass an array per parameter? and would like the array parameter to be optional
Example:
func startGame(teste: Array) -> String {
let randomIndex = Int(arc4random_uniform(UInt32(wordHard.count)))
let word = wordHard[randomIndex]
// verificando se existe palavra atribuida a variavel
if currentWord == "" {
currentWord = word
infoHelp.text = wordHardHelp[randomIndex]
}
return word
}
Thanks friends!
Your functions should be named starting with a lowercase letter.
– Leo Dabus
You need to pass the array type
func startGame(teste: [String]?) -> String {
– Leo Dabus
I still have error in the parameter
– Bruno Bafilli
Edit your question and put your code and the error that is giving
– Leo Dabus