I'm trying the following code to create a URL:
Approach 1:
let url = URL (string: "https://xxxx-xxxx.com/xxx.html?tokenID=PuUPbFjauRZNPrHQot3Xea70loblCZL3GP9HOrjDP7vTvP3ROWDZrmFJlvKBC1oQ&MobileKey=DE1C-7B19-9CFC83CB83C8||Apple,simulator&widvalue=cl-mobile-dashboard")
let requestObj = URLRequest(url: url!) // <<== error here!
However I'm getting the error
Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
Approach 2:
var _request : URLRequest?
if let webViewURL = URL(string: "https://xxxx-xxxx.com/xxx.html?tokenID=PuUPbFjauRZNPrHQot3Xea70loblCZL3GP9HOrjDP7vTvP3ROWDZrmFJlvKBC1oQ&MobileKey=DE1C-7B19-9CFC83CB83C8||Apple,simulator&widvalue=cl-mobile-dashboard") {
_request = URLRequest(url:webViewURL) // <<== execution not entering this block!!
}
Can anybody please help me with this? Thank you in advance.