Skip to content

Commit

Permalink
Issue #11 Solved
Browse files Browse the repository at this point in the history
  • Loading branch information
Datt committed Nov 5, 2019
1 parent 4a30919 commit 7bd68fe
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DPTagDetectionTextView.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
#

s.name = "DPTagDetectionTextView"
s.version = "1.5.2"
s.version = "1.5.4"
s.summary = "Tag detection and tag search for Textview."

# This description is used to generate tags and improve search results.
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,15 @@ class DPTagTextView: UITextView , UITextViewDelegate {
self.arrTags = []
self.arrRange = []
}
func setTagDetection(_ isTagDetection : Bool) {
func setTagDetection(_ isTagDetection : Bool, isEditable : Bool = false, isSelectable : Bool = false) {
self.removeGestureRecognizer(tapGesture)
if isTagDetection {
tapGesture = UITapGestureRecognizer(target: self, action: #selector(tapOnTextView(_:)))
// tapGesture.requiresExclusiveTouchType = false
tapGesture.delegate = self
self.addGestureRecognizer(tapGesture)
self.isEditable = false
self.isSelectable = false
self.isEditable = isEditable
self.isSelectable = isSelectable
} else {
self.isEditable = true
self.isSelectable = true
Expand Down Expand Up @@ -424,6 +426,13 @@ class DPTagTextView: UITextView , UITextViewDelegate {
super.addGestureRecognizer(gestureRecognizer)
return
}

}
extension DPTagTextView : UIGestureRecognizerDelegate {
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {

return true
}
}
extension String {
var utf16Count : Int {
Expand Down

0 comments on commit 7bd68fe

Please sign in to comment.