ios - 我想使用 swift 从游戏中将我在游戏中获得的分数发布到 Facebook,一切都在 Obj-C 上

标签 ios facebook swift xcode6

我的问题是,如何从 spritekit 发帖到 facebook?我已经在我的应用程序中设置了游戏并加载了框架,但我似乎没有找到 swift 的文档,有什么帮助吗?谢谢。

它会来自这里:

override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent) {

        //let nodeTouched = touches.
        var touch: UITouch = (touches.first as? UITouch)!

        var location = touch.locationInNode(self)

        var node = self.nodeAtPoint(location)

        println("\(node.name)")



        if node.name != "PTFB" {



            let gameScene = GameScene(size: size)

            let transition = SKTransition.doorsOpenHorizontalWithDuration(0.3)

            view?.presentScene(gameScene, transition: transition)

        } else {


            println("we are cooking")
            //here in the GameDone scene PFTB is the node that says post to fb
            var dict = NSMutableDictionary()


        }


    }

Xcode 6.3.2 Info.plist

最佳答案

我已经使用这个简单的 youtube 教程来完成您所要求的事情。然而,您将不得不将其调整为您想要上传到 Facebook 的内容。但这是视频的链接:here

对不起,我会评论,但我没有足够的代表哈哈

关于ios - 我想使用 swift 从游戏中将我在游戏中获得的分数发布到 Facebook,一切都在 Obj-C 上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30506118/

相关文章:

javascript - iOS 如何访问 CSS Url 中的库?

iOS UIPopoverController 委托(delegate)不工作,仍然为零

ios - 在中心 View 上滑动时,使用 iCarousel 加载 webView 不会滚动

发图片到粉丝专页墙的Java代码

SwiftUI Sheet 不更新变量

ios - Swift 3 在 ViewController 初始化后隐藏状态栏

ios - 绑定(bind)剂量似乎不适用于 ReactiveCocoa Swift

ios - 使用 Swift SDK 处理 Facebook 登录的开放 url

facebook - 从仪表板中删除 Facebook 登录产品

xcode - Assets 目录编译器错误 - 所有输入目录均不包含名为 "AppIcon"的匹配应用程序图标集