From adf13ae47c4742691656c1a7f8809908fab1ba8d Mon Sep 17 00:00:00 2001 From: fish Date: Wed, 15 Jul 2026 22:31:16 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E7=BD=AE=E6=8C=89=E9=92=AE=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=A1=AE=E8=AE=A4=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Note/FormatLogViewController.swift | 13 +++++++++++++ Note/FormatNoteViewController.swift | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/Note/FormatLogViewController.swift b/Note/FormatLogViewController.swift index d32d536..37ba294 100644 --- a/Note/FormatLogViewController.swift +++ b/Note/FormatLogViewController.swift @@ -184,6 +184,19 @@ class FormatLogViewController: UIViewController { } @objc private func didTapResetButton() { + let alert = UIAlertController( + title: "确认重置", + message: "确定要清空当前内容吗?", + preferredStyle: .alert + ) + alert.addAction(UIAlertAction(title: "取消", style: .cancel)) + alert.addAction(UIAlertAction(title: "重置", style: .destructive) { [weak self] _ in + self?.performReset() + }) + present(alert, animated: true) + } + + private func performReset() { textView.text = "" isFormatted = false formatButton.setTitle("格式化", for: .normal) diff --git a/Note/FormatNoteViewController.swift b/Note/FormatNoteViewController.swift index 782bdd0..b4af1c1 100644 --- a/Note/FormatNoteViewController.swift +++ b/Note/FormatNoteViewController.swift @@ -192,6 +192,19 @@ class FormatNoteViewController: UIViewController { } @objc private func didTapResetButton() { + let alert = UIAlertController( + title: "确认重置", + message: "确定要清空当前内容吗?", + preferredStyle: .alert + ) + alert.addAction(UIAlertAction(title: "取消", style: .cancel)) + alert.addAction(UIAlertAction(title: "重置", style: .destructive) { [weak self] _ in + self?.performReset() + }) + present(alert, animated: true) + } + + private func performReset() { textView.text = "" rightBarButtonMode = .paste isCloudFormatted = false