Last active
December 10, 2015 12:58
-
-
Save codeswimmer/4437547 to your computer and use it in GitHub Desktop.
iOS: How To Find A Word Definition In iOS Dictionary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* iOS 5 has a new framework to look for a word definition and present the definition. | |
| * | |
| * UIReferenceLibraryViewController is a subclas of UIViewController, so you can push | |
| * or present it as modal view controller to see the definition. | |
| */ | |
| NSString *term = @"Reference"; | |
| if ([UIReferenceLibraryViewController dictionaryHasDefinitionForTerm:term]) { | |
| NSLog(@"Term: %@, has definition", term); | |
| UIReferenceLibraryViewController *refVC = | |
| [[UIReferenceLibraryViewController alloc] initWithTerm:term]; | |
| [self presentModalViewController:refVC animated:YES]; | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment