I am using a web view in my application, getting the url from the text box. It works if the line starts with "http: //". I am trying to change the code so that it can also handle situations where users do not enter "http: //" or "https: //"
How to check if it has the URL "http: //"? How to change the url to add "http: //" to it?
NSString *URLString = textField.text; NSURL *URL = [NSURL URLWithString:URLString]; NSURLRequest *request = [NSURLRequest requestWithURL:URL]; [self.webView loadRequest:request];
source share