Hello everybody,
I am using a button trigger in Playgrounds to pass the button title to a function in another class.
@objc func letterButtonPressed(_ sender: UIButton) {
sender.isHidden = true
hiddenButtons.append(sender)
letter = sender.currentTitle?.uppercased()
if letter != nil {
game.checkLetterInWord(letter: letter!)
}
}
In this function above I check if the letter is nil first, so I don't undertstand why the function finds nil...
public func checkLetterInWord(letter: String!) -> Bool {
print(letter!)
let wordCharacters = Array(word)
print(wordCharacters)
return true
}
What am I doing wrong? Thank you for you help!