Closed albetoetecnia closed 5 years ago
I think this happens with multiline labels. Having same issue here.
you should call ActiveLabel.text.setter at last @albetoetecnia
let text = "remember_pwd".localized
let customType = ActiveType.custom(pattern: "\\s" + "click_here".localized + "\\b")
label_password_remember.numberOfLines = 0
label_password_remember.isUserInteractionEnabled = true
label_password_remember.isMultipleTouchEnabled = true
label_password_remember.enabledTypes = [.mention, .hashtag, .url, customType]
label_password_remember.textColor = .white
label_password_remember.text = text // remove this line
label_password_remember.customColor[customType] = UIColor.white
label_password_remember.customSelectedColor[customType] = Common.UIColorFromRGB(Common.Color.APP_COLOR_ACCENT)
label_password_remember.handleCustomTap(for: customType) { (element) in
print("Custom type tapped: \(element)")
self.performSegue(withIdentifier: "action_remember_password", sender: nil)
}
label_password_remember.text = text // add here
Env:
Use source integration instead of cocoapod, modify func onTouch(_ touch: UITouch)
:
...
case .ended, .cancelled:
guard let selectedElement = selectedElement else { return avoidSuperCall }
...
// case .cancelled:
// updateAttributesWhenSelected(false)
// selectedElement = nil
...
It's working!
If someone want you can use my fork .
pod 'ActiveLabel' , :git => 'git@github.com:RedMadRobot/ActiveLabel.swift.git', :branch => 'master'
Hi! If this is a real issue that needs to be fixed, please feel free to create a pull request. I'll merge it after a test for the next release.
Thanks everyone.
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.
Any updates. I am also facing the same issue. If the user taps for a little longer then it gets registered otherwise it is skipped.
@adiahuja07 did you tried my fork?
Hi! I'm having problems to get tap event on customType, neither working mentions, hashtags... This is my code: