在范围内找不到“ApplicationDelegate”

ORS*_*ios 5 ios swift

我正在安装 Facebook Graph API,我目前坚持以下。似乎我无法从场景委托中找到应用程序委托。

如果您使用的是 iOS 13 或更高版本,请将以下方法添加到您的 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]
    )
}
Run Code Online (Sandbox Code Playgroud)

当我应用上述内容时,出现以下错误。

Cannot find 'ApplicationDelegate' in scope
Run Code Online (Sandbox Code Playgroud)

小智 21

在你的 SceneDelegate 中导入 FBSDKCoreKit 并且它工作正常