Also trying to add the ability to detect a video and download it to the application in short a web-based app used for download any kind of video and has the ability to store
You need to use like this in swift
if let url = URL(string: "https://www.google.com"){
let requestObj = URLRequest(url: url)
Webview.loadRequest(requestObj)
}
Use URL
and URLRequest
instead NSURL
and NSURLRequest
in Swift.
let url = URL.init(string: "https://www.google.com")
let request = URLRequest.init(url: url!)
Webview.loadRequest(request)
For Reference you can refer : Reference
URL :
URL is a swift struct, so is passed by value.
NSURL :
NSURL is an Objective-C class. Is inherits from NSObject
URL
; use NSURL
when you need reference semantics or other Foundation-specific behavior.Both URL
and NSURL
is accepted in swift. but you have used swift then most refer URL
MORE.