iOS开发 UIReferenceLibraryViewController(词典)的使用

来源:互联网 发布:云南大学 知乎 编辑:程序博客网 时间:2024/05/17 22:56

UIReferenceLibraryViewController能够实现在自己的应用中使用字典查询词语的含义.

使用:

if ([UIReferenceLibraryViewController dictionaryHasDefinitionForTerm:@"country"]) {   UIReferenceLibraryViewController *refer = [[UIReferenceLibraryViewController alloc] initWithTerm:@"country"];   [self presentViewController:refer animated:YES completion:nil];} else {   NSLog(@"不支持");}

方法dictionaryHasDefinitionForTerm:去判断词典中是否有所选词的解释