添加打开备忘录跳转
This commit is contained in:
@@ -79,5 +79,16 @@ extension ViewController: UITableViewDelegate {
|
|||||||
|
|
||||||
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||||
tableView.deselectRow(at: indexPath, animated: true)
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user