释义搜索改回 Google,搜索词用释义加"是什么意思"
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -188,8 +188,9 @@ final class WordDetailViewController: UIViewController {
|
|||||||
|
|
||||||
private func searchMeaning() {
|
private func searchMeaning() {
|
||||||
Haptics.selection()
|
Haptics.selection()
|
||||||
guard let encoded = word.meaning.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed),
|
let text = "\(word.meaning) 是什么意思"
|
||||||
let url = URL(string: "https://baike.baidu.com/item/\(encoded)") else { return }
|
guard let query = text.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed),
|
||||||
|
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