CopyPastor

Detecting plagiarism made easy.

Score: 0.7550036311149597; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2018-08-27
by midhun p

Original Post

Original - Posted on 2015-01-11
by TimWhiting



            
Present in both answers; Present only in the new answer; Present only in the old answer;

override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { if editingStyle == .delete { machine.formulas.remove(at: indexPath.row) machine.saveFormulas() tableView.deleteRows(at: [indexPath], with: .fade) self.perform(#selector(reloadTable), with: nil, afterDelay: 2) } } @objc func reloadTable() { DispatchQueue.main.async { //please do all interface updates in main thread only self.tableView.reloadData() } }
As of Xcode 6.1.1, there are some tiny changes to Dash's answer.
override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool { return true } override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) { if (editingStyle == UITableViewCellEditingStyle.Delete) { // handle delete (by removing the data from your array and updating the tableview) } }

        
Present in both answers; Present only in the new answer; Present only in the old answer;