Skip to content

Commit

Permalink
fix: default value of cancelsTouchesInView is FALSE
Browse files Browse the repository at this point in the history
  • Loading branch information
iMattin committed Oct 13, 2021
1 parent ffe9b92 commit eded0ab
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import UIKit

public extension UIViewController {

func endEditingByTap() {
func endEditingByTap(_ cancelsTouchesInView: Bool = false) {
let gestureName = "End editing tap gesture recognizer"
let gesture = UITapGestureRecognizer(target: self, action: #selector(dismissKeyboard))

Expand All @@ -20,7 +20,7 @@ public extension UIViewController {
guard !((view.gestureRecognizers?.contains(where: { $0 == gesture }) ?? false)) else { return }
}

gesture.cancelsTouchesInView = true
gesture.cancelsTouchesInView = cancelsTouchesInView
view.addGestureRecognizer(gesture)
}

Expand Down

0 comments on commit eded0ab

Please sign in to comment.