UITapGestureRecognizer.swift 723 B

123456789101112131415161718192021222324252627
  1. //
  2. // UITapGestureRecognizer.swift
  3. // Mastodon
  4. //
  5. // Created by sxiaojian on 2021/2/19.
  6. //
  7. import UIKit
  8. extension UITapGestureRecognizer {
  9. static var singleTapGestureRecognizer: UITapGestureRecognizer {
  10. let tapGestureRecognizer = UITapGestureRecognizer()
  11. tapGestureRecognizer.numberOfTapsRequired = 1
  12. tapGestureRecognizer.numberOfTouchesRequired = 1
  13. return tapGestureRecognizer
  14. }
  15. static var doubleTapGestureRecognizer: UITapGestureRecognizer {
  16. let tapGestureRecognizer = UITapGestureRecognizer()
  17. tapGestureRecognizer.numberOfTapsRequired = 2
  18. tapGestureRecognizer.numberOfTouchesRequired = 1
  19. return tapGestureRecognizer
  20. }
  21. }