xcode beta 3 swift和FBLoginViewDelegate [英] xcode beta 3 swift and FBLoginViewDelegate

查看:54
本文介绍了xcode beta 3 swift和FBLoginViewDelegate的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在新版本的xcode(测试版3)中,我实现的用于在Facebook中处理Facebook登录的类不再起作用.它无法在之前起作用的地方使用FBLoginViewDelegate.当我使用扩展类时会发生这种情况:

with the new release of xcode (beta 3) the class I implemented to handle facebook login in facebook doesn't work anymore. it failed to use FBLoginViewDelegate where before it worked. this happens when I use to extends a class:

class LoginVC: MyViewController,MyDetailUsable,FBLoginViewDelegate

我安装了最后一个facebook sdk, 以防万一我忘记了一些东西,这是我为项目定义的设置:

I installed last facebook sdk, Just in case I forgot something, this are my settings defined for the project:

MyConnection/MyConnection-Bridging-Header.h  : #import <FacebookSDK/FacebookSDK.h>

//:configuration = Debug
SWIFT_OBJC_BRIDGING_HEADER = MyConnection/MyConnection-Bridging-Header.h

//:configuration = Release
SWIFT_OBJC_BRIDGING_HEADER = MyConnection/MyConnection-Bridging-Header.h

//:completeSettings = some
SWIFT_INSTALL_OBJC_HEADER = YES
//:configuration = Debug
CLANG_ENABLE_MODULES = YES
//:configuration = Release
CLANG_ENABLE_MODULES = YES
//:completeSettings = some
CLANG_ENABLE_MODULES = YES

您有任何避免或解决此问题的建议吗?

do you have any suggestion to avoid or solve this issue?

推荐答案

Facebook SDK具有名为FBGraphObject的协议,并且还具有相同的分类.在Swift中,协议和类的名称空间是统一的,因此您不会有冲突的名称.因此,您不能使用预编译的Facebook库.

Facebook SDK has a protocol named FBGraphObject and also a classed named the same. In Swift the namespace of protocols and classes is unified so you can't have conflicting names. For this reason you can't use the precompiled Facebook library.

您需要将FBGraphObject协议重命名为FBGraphObjectProtocol之类的其他名称,然后自己编译SDK.多数情况下,这种冲突也会导致SourceKitService.

You need to rename the FBGraphObject protocol to something else like FBGraphObjectProtocol and compile the SDK yourself. This conflict will also cause SourceKitService most of the times.

我在Apple开发人员论坛上写了有关此内容的文章,有人分叉了Facebook SDK进行更改.如果您使用的是Cocoapods,则可以使用pod 'Facebook-iOS-SDK', :git => 'https://github.com/pgaspar/facebook-ios-sdk.git'或自己下载源代码并进行更改.

I wrote about this on Apple dev forums and someone has forked the Facebook SDK to make the changes. If you're using Cocoapods you can use pod 'Facebook-iOS-SDK', :git => 'https://github.com/pgaspar/facebook-ios-sdk.git' or download the source code yourself and make the changes.

这篇关于xcode beta 3 swift和FBLoginViewDelegate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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