得到這個錯誤,而試圖實現滑動刪除 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變種? –