In my application, when the user add an object, can also add a link for this object and then the link can be opened in a webView. I tried to save a link without http://
I wrote an extension for String in Swift, to see if url string got http or https
extension String{ func isValidForUrl()->Bool{ if(self.hasPrefix("http") || self.hasPrefix("https")){ return true } return false } } if(urlString.isValidForUrl()) { //Do the thing here. }