Krelborn / KILabel

A simple to use drop in replacement for UILabel for iOS 7 and above that highlights links such as URLs, twitter style usernames and hashtags and makes them touchable.
MIT License
470 stars 133 forks source link

Missing Colon #60

Open RyPoints opened 8 years ago

RyPoints commented 8 years ago

I have a link that is like https://www.site.com/java/Java.do

It displays correctly, but when I tap it it links to https//www.site.com/java/Java.do

This is the exact same link with a missing colon after the https. Any idea what could cause that and how to mend it?

RyPoints commented 8 years ago

The link is correct here:

- (void)receivedActionForLinkType:(KILinkType)linkType string:(NSString*)string range:(NSRange)range
{
    NSLog(@"linkString: %@",string);

By the time it gets to Safari though, it is missing the colon.

RyPoints commented 8 years ago

This functions as expected:

    case KILinkTypeURL:
        if (_urlLinkTapHandler)
        {   
            if ([string containsString:@"https://"]) {
                [[UIApplication sharedApplication] openURL:[NSURL URLWithString:string]];
            } else {
                _urlLinkTapHandler(self, string, range);
            }
        }
        break;
    }