I'm following Swift's already implemented proposal guide https://github.com/apple/swift-evolution/blob/master/proposals/0022-objc-selectors.md to make an unambiguous selector declaration.
But the following code gives error:
amibiguous reference to member urlSession(_:dataTask:didBecome)"
let sel = #selector((URLSessionDataDelegate.urlSession(_:dataTask:didBecome:)) as (URLSessionDataDelegate) -> (URLSession, URLSessionDataTask, URLSessionDownloadTask) -> Void)
But after adding force unwrap, the error goes away:
let sel = #selector((URLSessionDataDelegate.urlSession(_:dataTask:didBecome:))! as (URLSessionDataDelegate) -> (URLSession, URLSessionDataTask, URLSessionDownloadTask) -> Void)
My question is - What is the correct way to make the selector here? Why does the error go away by adding force-unwrap? And am I doing it right by adding force unwrap here?