Atributika
Atributika copied to clipboard
onClick detection custom regex
i want to get the string with the custom regex how i can i achieve it?
commentTextLabel.attributedText = text .style(regex: "@[A-Za-z0-9_-]", style: mentions) .styleAll(normal)
onClick detection gives me the regex not the actual string
case .regex(<#T##String#>)
You can preprocess your text before put style to it, eg replace @[A-Za-z0-9_-] to <a href=$1>$1</a> and use linkdetector