得到这个错误,而试图实现滑动删除 IMA初学者,所以不要用一个解释的帮助将是不错的 我的待办事项列表保存的文件 进口基金会滑动删除细胞
class TodoListsaved {
class var sharedInstance : TodoListsaved {
struct Static {
static let instance : TodoListsaved = TodoListsaved()
}
return Static.instance
}
}
细胞FUNC
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as! TableViewCell
cell.selectionStyle = .None
let item = todoItems[indexPath.row]
cell.delegate = self
cell.toDoItem = item
return cell
//modify the cell to have check mark
if (item.completed) {
cell.accessoryType = UITableViewCellAccessoryType.Checkmark
}
else {
cell.accessoryType = UITableViewCellAccessoryType.None
}
return cell
}
我的数据源
进口的UIKit
class DataSource: NSObject {
let itenName: String
var completed : Bool
var deadline : NSDate
var UUID :String
init(itenName :String , completed :Bool = false , deadline : NSDate , UUID :String ) {
self.itenName = itenName
self.completed = completed
self.UUID = UUID
self.deadline = deadline
//self.subTitle = subTitle
}
具有u宣布在小区类文件的TodoItem变种? –