gpt4 book ai didi

ios - swift 3 : UITableViewRowActionStyle() "Missing Parameter" Error Msg

转载 作者:可可西里 更新时间:2023-11-01 04:13:14 25 4
gpt4 key购买 nike

当我滑动 UITableView 单元格时,将调用以下代码:

func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {

//Problem code
let delBut = UITableViewRowAction(style: UITableViewRowActionStyle(), title: delete_InLocal) { action, index in
//Setup

现在我已经开始迁移到 Swift 3,我在 UITableViewRowActionStyle() 上收到一条错误消息:

Missing argument for parameter 'rawValue' in call

有人知道在这种情况下 Swift 3 的语法是什么吗?

最佳答案

在 Swift 3 中从一些导入的枚举类型中删除了默认初始化器。

使用 UITableViewRowActionStyle.default(或者在您的情况下只需使用 .default)而不是 UITableViewRowActionStyle()

    let delBut = UITableViewRowAction(style: .default, title: delete_InLocal) { action, index in

关于ios - swift 3 : UITableViewRowActionStyle() "Missing Parameter" Error Msg,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39338480/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com