'UITextChecker code not giving correct result

I am using the standard method I think to check a word for validity. I have a 4 part array that is joined to make the word being verified. I have this placed in my touches began func in a SpriteKit scene however it always gives me the answer "CORRECT SPELLING" even when it is not.

Curiously when I put the exact same bit of code into my did move to view func so it runs when the game starts it works perfectly well. The code is exactly the same except instead of the joined array I just create a let word = "WORD" before the code. So I am guessing the problem must be something to do with my joined array??

This is my code

 let word = wordArray.joined()
        
        let textChecker = UITextChecker()
        let misspelledRange = textChecker.rangeOfMisspelledWord(
            in: word, range: NSRange(0..<word.utf16.count), startingAt: 0, wrap: false, language: "en_US")

                if misspelledRange.location != NSNotFound,
                   let guesses = textChecker.guesses(
                    forWordRange: misspelledRange, in: word, language: "en_US")
                {
                    print("Guess: \(String(describing: guesses.first))") //Output is: Guess: Optional("Tester")

                } else {
                    print("\(word) CORRECT SPELLING")
                }


Solution 1:[1]

Turned out my issue was that UITextChecker does not like full caps! Only accepts lower case spellings

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Waterboy