Nithin Raghunath
Nithin Raghunath

Reputation: 11

“NSURL” is not implicitly convertible to “URL”; did you mean to use “as” to explicitly convert? in swift 3

Error

func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool
{
    return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation)
}

Upvotes: 0

Views: 3473

Answers (1)

PGDev
PGDev

Reputation: 24341

In swift 3.0, the method signature for openURL is:

func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {

            return FBSDKApplicationDelegate.sharedInstance().application(applic‌​ation, open: url, sourceApplication: sourceApplication, annotation: annotation)
    }

In method signature, NSURL is changed to URL.

Upvotes: 3

Related Questions