MockTableView.swift 695 B

12345678910111213141516171819202122232425262728
  1. //
  2. // MockTableView.swift
  3. // SheeeeeeeeetTests
  4. //
  5. // Created by Daniel Saidi on 2018-10-17.
  6. // Copyright © 2018 Daniel Saidi. All rights reserved.
  7. //
  8. import UIKit
  9. class MockTableView: UITableView {
  10. var deselectRowInvokeCount = 0
  11. var deselectRowInvokePaths = [IndexPath]()
  12. var deselectRowInvokeAnimated = [Bool]()
  13. var reloadDataInvokeCount = 0
  14. override func deselectRow(at indexPath: IndexPath, animated: Bool) {
  15. deselectRowInvokeCount += 1
  16. deselectRowInvokePaths.append(indexPath)
  17. deselectRowInvokeAnimated.append(animated)
  18. }
  19. override func reloadData() {
  20. super.reloadData()
  21. reloadDataInvokeCount += 1
  22. }
  23. }