GesturePassTextView.swift 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // GesturePassTextView.swift
  3. // Bark
  4. //
  5. // Created by huangfeng on 2023/7/26.
  6. // Copyright © 2023 Fin. All rights reserved.
  7. //
  8. import UIKit
  9. class GesturePassTextView: UITextView {
  10. var superCell: UITableViewCell? = nil
  11. override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
  12. if let cell = superCell {
  13. cell.touchesBegan(touches, with: event)
  14. return
  15. }
  16. super.touchesBegan(touches, with: event)
  17. }
  18. override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {
  19. if let cell = superCell {
  20. cell.touchesMoved(touches, with: event)
  21. return
  22. }
  23. super.touchesMoved(touches, with: event)
  24. }
  25. override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
  26. if let cell = superCell {
  27. cell.touchesEnded(touches, with: event)
  28. return
  29. }
  30. super.touchesEnded(touches, with: event)
  31. }
  32. override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) {
  33. if let cell = superCell {
  34. cell.touchesCancelled(touches, with: event)
  35. return
  36. }
  37. super.touchesCancelled(touches, with: event)
  38. }
  39. }