0
刪除UITableView中的一行後,我創建的下一行將編輯設置爲true。我不確定這是爲什麼,但是這意味着在刪除一行後,我創建的下一行是indented on the left side by about 40 points。iOS Swift:UITableViewCell在刪除行後設置爲true
移除單元格之後,我需要將表格或單元格設置爲editing = false
嗎?
func removeItems(items: [CKRecord], indexPath: NSIndexPath) {
for item in items {
db.deleteRecordWithID(item.recordID) { (record, error) -> Void in
if error != nil {
println(error.localizedDescription)
}
dispatch_async(dispatch_get_main_queue()) {() -> Void in
if let index = find(exercises, item) {
exercises.removeAtIndex(index)
}
}
}
}
days.removeAtIndex(indexPath.row)
tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Automatic)
}
將'cell.editing = false'添加到'cellForRowAtIndexPath'解決了這個問題,但它看起來很沉重。 – colindunn 2015-03-08 21:47:02