Remove force unwrap in FetchedResultsControllerDelegate

This commit is contained in:
automactic 2016-05-09 09:39:32 -04:00
parent 7b762bb9ab
commit cd6089de3b
2 changed files with 4 additions and 2 deletions

View File

@ -277,7 +277,8 @@ class LibraryDownloadTBVC: UITableViewController, NSFetchedResultsControllerDele
case .Delete:
tableView.deleteRowsAtIndexPaths([indexPath!], withRowAnimation: .Fade)
case .Update:
self.configureCell(tableView.cellForRowAtIndexPath(indexPath!)!, atIndexPath: indexPath!)
guard let indexPath = indexPath, let cell = tableView.cellForRowAtIndexPath(indexPath) else {return}
configureCell(cell, atIndexPath: indexPath)
case .Move:
tableView.deleteRowsAtIndexPaths([indexPath!], withRowAnimation: .Fade)
tableView.insertRowsAtIndexPaths([newIndexPath!], withRowAnimation: .Fade)

View File

@ -242,7 +242,8 @@ class LibraryLocalTBVC: UITableViewController, NSFetchedResultsControllerDelegat
case .Delete:
tableView.deleteRowsAtIndexPaths([indexPath!], withRowAnimation: .Fade)
case .Update:
self.configureCell(tableView.cellForRowAtIndexPath(indexPath!)!, atIndexPath: indexPath!)
guard let indexPath = indexPath, let cell = tableView.cellForRowAtIndexPath(indexPath) else {return}
configureCell(cell, atIndexPath: indexPath)
case .Move:
tableView.deleteRowsAtIndexPaths([indexPath!], withRowAnimation: .Fade)
tableView.insertRowsAtIndexPaths([newIndexPath!], withRowAnimation: .Fade)