我想实现UICollectionView水平和无限滚动?
uiscrollview uiscrollviewdelegate ios uicollectionview swift
我实现editActionsForRowAtIndexPath和commitEditingStyle轻扫是工作,但没有编辑动作出现在UITableViewCell
我的实施editActionsForRowAtIndexPath和commitEditingStyle如下:
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)
任何帮助将不胜感激
我用完成处理程序调用rest web servic,如果成功,我发送NSNotification.
问题是如何编写单元测试以声明在成功的情况下发送通知.
任何帮助将不胜感激.