我在我的SpriteKit游戏(iOS 8 + Swift)中整合社交分享。一切正常,但我收到以下错误:"启动服务:invalidationHandler调用"。知道如何修复错误吗?这是我的代码:
func shareWithFacebook() {
if SLComposeViewController.isAvailableForServiceType(SLServiceTypeFacebook) {
let facebookSheet = SLComposeViewController(forServiceType: SLServiceTypeFacebook)
facebookSheet.setInitialText("Test FB post with score of \(score)")
self.presentViewController(facebookSheet, animated: true, completion: nil)
} else {
println("facebook not available")
}
}
我还尝试在呈现ViewController之前添加一个sourceView,但仍然出错...
facebookSheet.popoverPresentationController?.sourceView = self.view