diff --git a/Note/ClipInboxViewController.swift b/Note/ClipInboxViewController.swift index f437421..b55a0d4 100644 --- a/Note/ClipInboxViewController.swift +++ b/Note/ClipInboxViewController.swift @@ -96,10 +96,16 @@ class ClipInboxViewController: UIViewController { let isEmpty = clips.isEmpty emptyLabel.isHidden = !isEmpty tableView.isHidden = isEmpty - navigationItem.rightBarButtonItem?.isEnabled = !isEmpty } @objc private func didTapClearButton() { + guard !clips.isEmpty else { + let alert = UIAlertController(title: "提示", message: "收集箱为空,没有可清空的内容。", preferredStyle: .alert) + alert.addAction(UIAlertAction(title: "确定", style: .default)) + present(alert, animated: true) + return + } + let alert = UIAlertController( title: "清空收集箱", message: "确定要删除所有保存的文案吗?此操作不可撤销。",