小编Abd*_*man的帖子

33
推荐指数
4
解决办法
3万
查看次数

我实现了editActionsForRowAtIndexPath和commitEditingStyle,但在刷单元格时,tableViewCell上没有显示编辑操作

我实现editActionsForRowAtIndexPathcommitEditingStyle轻扫是工作,但没有编辑动作出现在UITableViewCell

我的实施editActionsForRowAtIndexPathcommitEditingStyle如下:

func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
        if editingStyle == UITableViewCellEditingStyle.Delete {
            //I did some work here
            tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: UITableViewRowAnimation.Automatic)
        }
    }


 func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [AnyObject]?  {

    let deleteAction = UITableViewRowAction(style: UITableViewRowActionStyle.Normal, title: "Delete" , handler: { (action:UITableViewRowAction!, indexPath:NSIndexPath!) -> Void in
        //I did some work here
        tableView.reloadData()
    })


    return [deleteAction]
}
Run Code Online (Sandbox Code Playgroud)

任何帮助将不胜感激

uitableview tableviewcell ios swift uitableviewrowaction

8
推荐指数
2
解决办法
1万
查看次数

如何写单元测试接收nsnotification异步?

我用完成处理程序调用rest web servic,如果成功,我发送NSNotification.

问题是如何编写单元测试以声明在成功的情况下发送通知.

任何帮助将不胜感激.

nsnotification nsnotificationcenter ios xctest swift

5
推荐指数
1
解决办法
1921
查看次数

如何在iOS中动画/回放手写图形?

有没有人想过如何在iOS中播放手写图形?

core-graphics ios swift

-3
推荐指数
1
解决办法
279
查看次数