Access iOS dictionary programmatically

There is an API for bringing up the built-in dictionary UI (not the original question but raised in some of the responses), including checking for whether a given word is defined:

if ([UIReferenceLibraryViewController dictionaryHasDefinitionForTerm:@"word"]) {
    UIReferenceLibraryViewController* ref = 
        [[UIReferenceLibraryViewController alloc] initWithTerm:@"word"];
    [currentViewController presentViewController:ref animated:YES completion:nil];
}

Leave a Comment