Изменить "Удалить текст" на Swipe Eureka - PullRequest
0 голосов
/ 23 марта 2020

Есть ли способ изменить текст ContextualAction, чтобы он больше не говорил "удалить"?

This is the Delete Button that I'm talking about

1 Ответ

0 голосов
/ 23 марта 2020

Вы можете просто создать метод делегата trailingSwipeActionsConfigurationForRowAt, как показано ниже, и настроить его по своему усмотрению:

extension YOURVIEWCONROLLER: UITableViewDelegate{
func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {

    let removeAction = UIContextualAction(style: .destructive, title: "Remove") { action, view, complete in
        //Your code
        Utility.main.showAlert(message: "Removed Pressed", title: "Alert")
        complete(true)
    }
    doneAction.backgroundColor = UIColor.red

    return UISwipeActionsConfiguration(actions: [removeAction])
}
}

или

В файле Core.swift вам необходимо отредактировать его функцию.

...