Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find any actions for URL applewebdata

i try to open link that tapped in app, like this:

- (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)url inRange:(NSRange)characterRange
{

    UIApplication *myApp = [UIApplication sharedApplication];
    [myApp openURL:url];

    return YES;
}

But in result, nothing happens.

Just: Could not find any actions for URL applewebdata://10FC0C33-238E-481E-BF44-8D0BA2B1FBB7/%22https://vk.com/feed/%22 without any result.

like image 677
Denis Kosov Avatar asked Dec 17 '16 13:12

Denis Kosov


1 Answers

I had this exact error. The problem was that I declared the delegate method

    public func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange) -> Bool {

in a (Swift) extension of the (Objective-C) class, but the class header had the protocol conformance declaration.

It all worked once I moved the UITextFieldDelegate declaration to the extension, where the delegate method was

extension MyViewController: UITextViewDelegate
like image 53
Stefan Avatar answered Sep 30 '22 11:09

Stefan