我正在创建一个由4个单词组成的炒文字游戏,因此有4个文本框。如何将UITextField的文本与字符串进行比较?
当用户输入的字符串是正确的单词的长度时,我想检查该序列是否等于实际单词。
If it is, I want to clear the text field and return "YES!".
If it is not, I want to clear the text field completely so the user can try again.
举例:如果实际的词是“逻辑”和用户输入“GOLIC”作为他的猜测正确的话,我想文本字段完全清除,因此用户可以再次尝试。
If the actual word is "LOGIC" and the user enters "LOGIC", I want the text field to clear and display the string "YES!"
任何帮助非常感谢!