pEpForiOS/UI/EmailDisplay/EmailListViewController.swift
changeset 3866 b5901734830a
parent 3678 cbe8bbfdfb7f
child 3909 2c0076194a16
equal deleted inserted replaced
3865:bbbcc1f7498f 3866:b5901734830a
   451 
   451 
   452 // MARK: - EmailListModelDelegate
   452 // MARK: - EmailListModelDelegate
   453 
   453 
   454 extension EmailListViewController: EmailListViewModelDelegate {
   454 extension EmailListViewController: EmailListViewModelDelegate {
   455     func emailListViewModel(viewModel: EmailListViewModel, didInsertDataAt indexPath: IndexPath) {
   455     func emailListViewModel(viewModel: EmailListViewModel, didInsertDataAt indexPath: IndexPath) {
       
   456         Log.shared.info(component: #function, content: "\(model?.rowCount ?? 0)")
   456         tableView.beginUpdates()
   457         tableView.beginUpdates()
   457         tableView.insertRows(at: [indexPath], with: .automatic)
   458         tableView.insertRows(at: [indexPath], with: .automatic)
   458         tableView.endUpdates()
   459         tableView.endUpdates()
   459     }
   460     }
   460     
   461     
   461     func emailListViewModel(viewModel: EmailListViewModel, didRemoveDataAt indexPath: IndexPath) {
   462     func emailListViewModel(viewModel: EmailListViewModel, didRemoveDataAt indexPath: IndexPath) {
       
   463         Log.shared.info(component: #function, content: "\(model?.rowCount ?? 0)")
   462         tableView.beginUpdates()
   464         tableView.beginUpdates()
   463         tableView.deleteRows(at: [indexPath], with: .automatic)
   465         tableView.deleteRows(at: [indexPath], with: .automatic)
   464         tableView.endUpdates()
   466         tableView.endUpdates()
   465     }
   467     }
   466     
   468     
   467     func emailListViewModel(viewModel: EmailListViewModel, didUpdateDataAt indexPath: IndexPath) {
   469     func emailListViewModel(viewModel: EmailListViewModel, didUpdateDataAt indexPath: IndexPath) {
       
   470         Log.shared.info(component: #function, content: "\(model?.rowCount ?? 0)")
   468         tableView.beginUpdates()
   471         tableView.beginUpdates()
   469         tableView.reloadRows(at: [indexPath], with: .none)
   472         tableView.reloadRows(at: [indexPath], with: .none)
   470         tableView.endUpdates()
   473         tableView.endUpdates()
   471     }
   474     }
   472     
   475