Added the name of the item to be renamed to the dialog title.

This commit is contained in:
Maurice Parker 2019-04-15 15:10:30 -05:00
parent 55a737f852
commit 3fdb1fbde6
1 changed files with 4 additions and 6 deletions

View File

@ -233,17 +233,15 @@ class MasterViewController: UITableViewController {
func rename(indexPath: IndexPath) {
let title = NSLocalizedString("Rename", comment: "Rename")
let name = (nodeFor(indexPath: indexPath)?.representedObject as? DisplayNameProvider)?.nameForDisplay ?? ""
let formatString = NSLocalizedString("Rename “%@”", comment: "Feed finder")
let title = NSString.localizedStringWithFormat(formatString as NSString, name) as String
let alertController = UIAlertController(title: title, message: nil, preferredStyle: .alert)
let cancelTitle = NSLocalizedString("Cancel", comment: "Cancel")
alertController.addAction(UIAlertAction(title: cancelTitle, style: .cancel))
// TODO: Add the title of what is being renamed...
// let formatString = NSLocalizedString("Rename %@", comment: "Feed finder")
// let message = NSString.localizedStringWithFormat(formatString as NSString, )
let renameTitle = NSLocalizedString("Rename", comment: "Rename")
let renameAction = UIAlertAction(title: renameTitle, style: .default) { [weak self] action in