     
     func getAutoCompleteWord() -> String {
         var searchTerm = curWord + keyboardRows[selectedRowIndex][selectedCharIndex]
-        for i in dictStart...(dictionary.count-1) {
+        for i in dictStart...(dictionary.count - 1) {
             if (dictionary[i].characters.count >= searchTerm.characters.count) {
                 if (dictionary[i].hasPrefix(searchTerm.lowercased())) {
                     return dictionary[i]

            return ""
        }
        let words = text?.components(separatedBy: " ")
        return words![words!.count-1]
    }
}

        enterDelete()
        nextWord = getAutoCompleteWord()
        if (curWord != "") {
        for _ in 0...curWord.characters.count - 1 {
            (textDocumentProxy as UIKeyInput).deleteBackward()
        }
        (textDocumentProxy as UIKeyInput).insertText(curWord)
