I have a class:
class GameManager {...
and within it I have this func:
func startGame() {
msgTimer = Timer(timeInterval: 0.5, target: self, selector: #selector(typeMessage(_:)), userInfo: nil, repeats: true)
}
and the selector it calls:
@objc func typeMessage(_ sender:Timer) {
if textCount > strInitText.characters.count {
let strThisChar = strInitText[strInitText.index(strInitText.startIndex, offsetBy: textCount)]
strDisplayText = strDisplayText + String(strThisChar)
print(strDisplayText)
}
}
But the selector never gets called.
