如何在 Swift iOS 应用程序的头文件中导入 FacebookSDK [英] How to import FacebookSDK in Header file of Swift iOS application

查看:39
本文介绍了如何在 Swift iOS 应用程序的头文件中导入 FacebookSDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将我的应用程序从 Objective-C 转换为 swift.在我的 swift 应用程序中,我创建了一个头文件,如 以下教程 ,但我收到错误 'FacebookSDK/FacebookSDK.h' file not found 而不是我在我的应用程序中成功导入了 facebookSDK .请指导我如何快速导入 facebookSDK.

I am converting my application from Objective- C to swift . In my swift application I have created a header file as explained in following tutorial , but i am getting error 'FacebookSDK/FacebookSDK.h' file not found rather than I imported facebookSDK successfully in my application . Please guid me how to import facebookSDK in swift.

推荐答案

Facebook 自 SDK v4.1 起就支持 swift,因此 现在不需要桥接标头.(顺便说一下,从这个版本开始,他们也弃用了 FacebookSDK 而支持 FBSDKCoreKit)

Facebook supports swift natively as of SDK v4.1, so bridging headers are not required now. (by the way, they also deprecated FacebookSDK in favor of FBSDKCoreKit since this version)

直接导入你需要的模块即可:

Just import the module you need directly:

import FBSDKCoreKit
import FBSDKShareKit
import FBSDKLoginKit

这篇关于如何在 Swift iOS 应用程序的头文件中导入 FacebookSDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆