【问题标题】:Swift UIBarButtonItem TitleSwift UIBarButtonItem 标题
【发布时间】:2019-06-05 19:17:59
【问题描述】:
@IBAction
func buttonTapped(_ sender: UIBarButtonItem) {
  guard let title = sender.currentTitle,
        let button = Buttons(rawValue: title) else { return }
}

我收到的错误是“‘UIBarButtonItem’类型的值没有成员‘currentTitle’,我也有每个按钮的枚举和案例。

【问题讨论】:

    标签: ios swift uibarbuttonitem


    【解决方案1】:

    试试gaurd let title = sender.title

    【讨论】:

    • 成功了!我以为我曾经尝试过,但那肯定是不同的变化,因为现在他们注册了。 ? 我投了票,但我的声誉分数仍然很低,感谢您的帮助!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多