Skip to content

Commit

Permalink
ActiveLabel can cancelTouchesInView - fix weird behaviour when used i…
Browse files Browse the repository at this point in the history
…n UICollectionView & UITableView (UIScrollView subclasses)
  • Loading branch information
kaandedeoglu committed Oct 8, 2015
1 parent d7ef76e commit 40f874b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ActiveLabel/ActiveLabel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ public class ActiveLabel: UILabel {

let touchRecognizer = UILongPressGestureRecognizer(target: self, action: "onTouch:")
touchRecognizer.minimumPressDuration = 0.00001
touchRecognizer.cancelsTouchesInView = false
touchRecognizer.delegate = self
addGestureRecognizer(touchRecognizer)

Expand Down Expand Up @@ -341,4 +340,11 @@ extension ActiveLabel: UIGestureRecognizerDelegate {
return true
}

}
public func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldRequireFailureOfGestureRecognizer otherGestureRecognizer: UIGestureRecognizer) -> Bool {
return true
}

public func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldBeRequiredToFailByGestureRecognizer otherGestureRecognizer: UIGestureRecognizer) -> Bool {
return true
}
}

0 comments on commit 40f874b

Please sign in to comment.