UIReferenceLibraryViewController.dictionaryHasDefinition(forTerm:) 总是返回 false?

问题描述 投票:0回答:1

这个问题几乎概括了一切。我检查了很多不同的单词,但没有一个返回 true。这是我的代码:

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
    print("accessed")
    print(words[indexPath.row])
    if UIReferenceLibraryViewController.dictionaryHasDefinition(forTerm: words[indexPath.row]) {
        print("in")
        let ref: UIReferenceLibraryViewController = UIReferenceLibraryViewController(term: words[indexPath.row])
        self.present(ref, animated: true, completion: nil)
    }
}

我正在尝试显示给定单词的定义。任何帮助,将不胜感激。谢谢!

swift definition
1个回答
0
投票

您是否在模拟器或设备中安装了词典(牛津词典或其他词典)?如果你没有,你需要。

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.