Skip to content

Commit

Permalink
Merge pull request #19 from iMattin/main
Browse files Browse the repository at this point in the history
fix: default value of cancelsTouchesInView is FALSE
  • Loading branch information
MohammadRezaAnsari authored Oct 13, 2021
2 parents ffe9b92 + eded0ab commit 8c264e2
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 8c264e2

Please sign in to comment.