I am just starting on IOS/SWIFT and I am running though some basic tasks...
I have seem to run across an issue I can not figure out nor understand the issue.
I want to display the webpage in my web view but the optional value is returning NIL but holds a value line before...
if let address = webSite {
let webURL = URL(string: address) //webURL=="google.com" at this point
let urlRequest = URLRequest(url: webURL!)
webView.loadRequest(urlRequest)
}
urlRequest is NILL after trying the URLRequest..even tho webURL holds a value of "google.com" Which then results in the loadRequest crashing with the error
"Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value"
I believe I understand the concept of the optional value that it will return NILL if it holds no value but I can produce the value of "google.com" at URL call.