NSRange range = textView.selectedRange; if (range.location == NSNotFound) { //The textfield was not selected. } else { //There is a valid range. }