I have implemented what I think is the function from UITextViewDelegate, which deals with URLs being tapped in a UITextView, however the functions now being called in my code.
This is the function I have used from the delegate.
func textView(textView: UITextView!, shouldInteractWithURL URL: NSURL!, inRange characterRange: NSRange) -> Bool {
println("Link Selected!")
}
However I have used breakpoints and the code isn't even being accessed at runtime? Is this the correct function or is there an alternative?
You need to make sure that the class implementing the delegate protocol is set as the delegate for the UITextView
.
self.textView.delegate = self
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With