1
我写了下面的代码。我试图让它的功能像UIBarButtonItem
编辑项目功能,但使用UIButton
而不是因为我有一个自定义导航栏,但我有几个编译错误。该功能应该允许在按下按钮时进行编辑,并在再次按下时完成编辑。iOS swift 3使用UIButton代替UIBarButton编码tableview编辑按钮
@IBAction func edit(sender: UIButton){
if [tableView.isEditing] == YES {
[self.tableView .setEditing(false, animated: false)]
}
else{
[self.tableView .setEditing(true, animated: true)]
}
}
傻我:(。感谢这么多。 –