From ed0643c4ad6e032f7e37227938b83edd31e68691 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Tue, 10 May 2022 22:44:23 -0400 Subject: [PATCH] Change explore swipe action titles --- Tusker/Screens/Explore/ExploreViewController.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Tusker/Screens/Explore/ExploreViewController.swift b/Tusker/Screens/Explore/ExploreViewController.swift index 2cc36b02..af15750b 100644 --- a/Tusker/Screens/Explore/ExploreViewController.swift +++ b/Tusker/Screens/Explore/ExploreViewController.swift @@ -259,20 +259,24 @@ class ExploreViewController: UIViewController, UICollectionViewDelegate { } private func trailingSwipeActionsForCell(at indexPath: IndexPath) -> UISwipeActionsConfiguration? { + let title: String let handler: UIContextualAction.Handler switch dataSource.itemIdentifier(for: indexPath) { case let .list(list): + title = NSLocalizedString("Delete", comment: "delete swipe action title") handler = { (_, _, completion) in self.deleteList(list, completion: completion) } case let .savedHashtag(hashtag): + title = NSLocalizedString("Unsave", comment: "unsave swipe action title") handler = { (_, _, completion) in self.removeSavedHashtag(hashtag) completion(true) } case let .savedInstance(url): + title = NSLocalizedString("Unsave", comment: "unsave swipe action title") handler = { (_, _, completion) in self.removeSavedInstance(url) completion(true) @@ -283,7 +287,7 @@ class ExploreViewController: UIViewController, UICollectionViewDelegate { } return UISwipeActionsConfiguration(actions: [ - UIContextualAction(style: .destructive, title: NSLocalizedString("Delete", comment: "delete swipe action title"), handler: handler) + UIContextualAction(style: .destructive, title: title, handler: handler) ]) }