I'm trying to delete an entire word in a text field when I do a long press on the delete key.
I attempted to run a while loop to check for a space (" "), and then delete any char that did not match space (" ") - but...
1) I am not sure if how I'm attempting to search the text field is correct
2) The way I'm attempting my loop is broken because of that
func delLong(){
var proxy = textDocumentProxy as UITextDocumentProxy
while [-1] != " "{
proxy.deleteBackward()
}
}