Swift 3 - No '+' candidates produce the expected contextual result type 'URL'

Question

I just upgraded my swift project to swift 3 and i want to open url one of buttons onclick. Any help with little explanation would be appreciated.

The error says;

No '+' candidates produce the expected contextual result type 'URL'

Here is the code;

@IBAction func GPerformance(_ sender: UIButton) {

    if let url = URL(string: "https://blablanet.blabla.gov.tr/analytics/saw.dll?Dashboard&NQUser="+USERNAME+"&NQPassword="+USERPASSWORD+"&portalPath=/shared/REPORT/_portal/PERFORMANCE&Page=WEEK%20Performance") {
        if #available(iOS 10.0, *) {
            UIApplication.shared.open(url, options: [:])
        } else {
            UIApplication.shared.openURL(url)
        }
    }


}

Show source
| url   | swift3   2017-01-06 08:01 0 Answers

Answers to Swift 3 - No '+' candidates produce the expected contextual result type 'URL' ( 0 )

Leave a reply to - Swift 3 - No '+' candidates produce the expected contextual result type 'URL'

◀ Go back