Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find 'ApplicationDelegate' in scope

Tags:

ios

swift

I am installing the Facebook Graph API and Im currently stuck on the following. It seems like I am unable to find the Application Delegate from the Scene Delegate.

If you are using iOS 13 or above please add the following method to your SceneDelegate

// Swift
//
// SceneDelegate.swift

func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
    guard let url = URLContexts.first?.url else {
        return
    }

    ApplicationDelegate.shared.application(
        UIApplication.shared,
        open: url,
        sourceApplication: nil,
        annotation: [UIApplication.OpenURLOptionsKey.annotation]
    )
}

When I apply the above I get the following error.

Cannot find 'ApplicationDelegate' in scope
like image 655
ORStudios Avatar asked Oct 28 '20 11:10

ORStudios


1 Answers

import FBSDKCoreKit in your SceneDelegate And It Works Fine

like image 60
Karan Mehra Avatar answered Oct 19 '22 00:10

Karan Mehra