Swift UIBarButtonItem Заголовок - PullRequest
1 голос
/ 05 июня 2019
@IBAction
func buttonTapped(_ sender: UIBarButtonItem) {
  guard let title = sender.currentTitle,
        let button = Buttons(rawValue: title) else { return }
}

Я получаю сообщение об ошибке: «Значение типа« UIBarButtonItem »не имеет члена« currentTitle », у меня также есть перечисления и регистры для каждой кнопки.

1 Ответ

0 голосов
/ 05 июня 2019

Попробуйте gaurd let title = sender.title

...