Hello I’m using a WebView to load a specific URL from a String but in a WebView but it returns as nil.
var linkobject = "http://prf.hn/click/camref:1011l62a/creativeref:1100l4014/destination:http://nl.tommy.com/Tommy-Cares-Tas/C827884386,nl_NL,pd.html#!i=0&color=000&size=OS&utm_source=performancehorizon&utm_medium=affiliate&utm_campaign=FW15&utm_term=(UserID)&utm_content=feed&cmpid=ch:affiliate|dp:ecom|so:performancehorizon|cp:fw15|co:uk|pi:(UserID)|cr:feed&LGWCODE=8718937448230;88093;5350?LGWCODE=8718937448230;105153;6183"
if let url = NSURL(string:linkobject) {
var req = NSURLRequest(URL: url)
if count(url.description) != 0 {
self.webView.contentMode = UIViewContentMode.ScaleAspectFit
self.webView.loadRequest(req)
}
}
Now i’ve read the in official documentation that this url doesn’t apply with the RFC 2396 standard, that's why it gives me a nil object.
The NSURL class fails to create a new NSURL object if the path being passed is not well formed; the path must comply with RFC 2396
Does somebody know a way how i could load this type of url in my webview or bypass or override NSURL in any way so my string can be converted to an NSURL? Love to hear suggestions, modifing the url is not a option because it’s supplied as an affiliate url.