Guest User

Untitled

a guest
Jan 20th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. var numberOfRecords:Int = 0
  2.  
  3. func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
  4. if editingStyle == .delete {
  5. try? FileManager.default.removeItem(at: getDiretory().appendingPathComponent("(indexPath.row - 1).m4a"))
  6. UserDefaults.standard.removeObject(forKey: "myNumber")
  7. tableView.deleteRows(at: [indexPath], with: .fade)
  8. tableView.reloadData()
  9. }
  10. }
Add Comment
Please, Sign In to add comment