Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/103.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/43.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios Swift中的表视图提交编辑样式_Ios_Iphone_Uitableview_Swift - Fatal编程技术网

Ios Swift中的表视图提交编辑样式

Ios Swift中的表视图提交编辑样式,ios,iphone,uitableview,swift,Ios,Iphone,Uitableview,Swift,我有这个代码,我想把它转换成swift代码 - (UITableViewCellEditingStyle)tableView:(UITableView *)aTableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { return UITableViewCellEditingStyleNone; } 默认情况下,我得到的是删除编辑样式,我不想要任何样式。 提前感谢 您可以通过命令单击Swift源文件或文件中的U

我有这个代码,我想把它转换成swift代码

- (UITableViewCellEditingStyle)tableView:(UITableView *)aTableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{

    return UITableViewCellEditingStyleNone;
}
默认情况下,我得到的是删除编辑样式,我不想要任何样式。
提前感谢

您可以通过命令单击Swift源文件或文件中的
UITableViewDelegate
标识符来获得方法的正确声明。这使Xcode向您显示
UITableView.h
的Swift版本。在那里,您可以搜索
editingstyleforrowatinexpath
,以找到确切的方法签名。一旦你做到了这一点,剩下的就很简单了:

func tableView(tableView: UITableView!, editingStyleForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCellEditingStyle {
    return .None
}

请注意,由于方法的声明返回类型,Swift推断
None
UITableViewCellEditingStyle
枚举的成员。

您可以通过命令单击Swift源文件或文件中的
UITableViewDelegate
标识符来获得方法的正确声明。这使Xcode向您显示
UITableView.h
的Swift版本。在那里,您可以搜索
editingstyleforrowatinexpath
,以找到确切的方法签名。一旦你做到了这一点,剩下的就很简单了:

func tableView(tableView: UITableView!, editingStyleForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCellEditingStyle {
    return .None
}

请注意,由于方法的声明返回类型,Swift推断
None
UITableViewCellEditingStyle
枚举的成员。

您遇到的问题到底是什么?您遇到的问题到底是什么?