diff --git a/Note/ViewController.swift b/Note/ViewController.swift index 70df32d..717555f 100644 --- a/Note/ViewController.swift +++ b/Note/ViewController.swift @@ -79,5 +79,16 @@ extension ViewController: UITableViewDelegate { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { tableView.deselectRow(at: indexPath, animated: true) + + let item = menuItems[indexPath.section][indexPath.row] + if item.title == "打开备忘录" { + openSystemNotesApp() + } + } + + private func openSystemNotesApp() { + guard let url = URL(string: "mobilenotes://") else { return } + guard UIApplication.shared.canOpenURL(url) else { return } + UIApplication.shared.open(url, options: [:], completionHandler: nil) } }