@@ -188,9 +188,8 @@ final class WordDetailViewController: UIViewController {
|
|||||||
|
|
||||||
private func searchMeaning() {
|
private func searchMeaning() {
|
||||||
Haptics.selection()
|
Haptics.selection()
|
||||||
let text = "\(word.word) 是什么意思"
|
guard let encoded = word.meaning.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed),
|
||||||
guard let query = text.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed),
|
let url = URL(string: "https://baike.baidu.com/item/\(encoded)") else { return }
|
||||||
let url = URL(string: "https://www.google.com/search?q=\(query)") else { return }
|
|
||||||
present(SFSafariViewController(url: url), animated: true)
|
present(SFSafariViewController(url: url), animated: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user