Skip to content

Instantly share code, notes, and snippets.

Created March 10, 2016 20:01
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
# coding: utf-8
from objc_util import ObjCClass
UITextChecker = ObjCClass('UITextChecker')
def check_word(word, lang='en_US'):
c =
check = c.rangeOfMisspelledWordInString_range_startingAt_wrap_language_
misspelled_range = check(word, (0, len(word)), 0, False, lang)
return (misspelled_range.location != 0)
test_words = ['foo', 'bar', 'baz', 'quuz', 'cat', 'dog']
for word in test_words:
print '%s: %s' % (word, check_word(word))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment