optonaut / ActiveLabel.swift

UILabel drop-in replacement supporting Hashtags (#), Mentions (@) and URLs (http://) written in Swift
MIT License
4.47k stars 686 forks source link

It needs 5s to get the action #158

Closed remlostime closed 5 years ago

remlostime commented 7 years ago

It takes me 5s to tap hash tag or name tag to trigger the touch action. Otherwise, there is no response. Don't know why?

chrisdhaan commented 7 years ago

@remlostime are you experiencing this issue within a UITableViewCell? I get the normal response in a plain UIView. But when trying to using the ActiveLabel in a UITableViewCell I am seeing a several second delay. Almost as if it's a long press gesture opposed to a tap.

remlostime commented 7 years ago

That's true. It's in cell. Do you have idea how to fix it? @chrisdhaan

chrisdhaan commented 7 years ago

@remlostime I have not found a solution yet and spent almost an entire day looking for one. @poolqf is this behavior that you experience when running Active Label in a UITableViewCell?

decoyfox commented 7 years ago

@chrisdhaan @remlostime You can fix this using:

tap.cancelsTouchesInView = false

For example I have a gesture on my entire view, but the above line will pass the touch through to the ActiveLabel, and should work!

let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(CommentsViewController.dismissKeyboard))

tap.cancelsTouchesInView = false

view.addGestureRecognizer(tap)
stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.