MockTableView.swift 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. import Sheeeeeeeeet
  10. class MockItemTableView: ActionSheetItemTableView {
  11. var deselectRowInvokeCount = 0
  12. var deselectRowInvokePaths = [IndexPath]()
  13. var deselectRowInvokeAnimated = [Bool]()
  14. var reloadDataInvokeCount = 0
  15. override func deselectRow(at indexPath: IndexPath, animated: Bool) {
  16. deselectRowInvokeCount += 1
  17. deselectRowInvokePaths.append(indexPath)
  18. deselectRowInvokeAnimated.append(animated)
  19. }
  20. override func reloadData() {
  21. super.reloadData()
  22. reloadDataInvokeCount += 1
  23. }
  24. }
  25. class MockButtonTableView: ActionSheetButtonTableView {
  26. var deselectRowInvokeCount = 0
  27. var deselectRowInvokePaths = [IndexPath]()
  28. var deselectRowInvokeAnimated = [Bool]()
  29. var reloadDataInvokeCount = 0
  30. override func deselectRow(at indexPath: IndexPath, animated: Bool) {
  31. deselectRowInvokeCount += 1
  32. deselectRowInvokePaths.append(indexPath)
  33. deselectRowInvokeAnimated.append(animated)
  34. }
  35. override func reloadData() {
  36. super.reloadData()
  37. reloadDataInvokeCount += 1
  38. }
  39. }