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