Change explore swipe action titles
This commit is contained in:
parent
1e2947ceba
commit
ed0643c4ad
|
@ -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)
|
||||
])
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue