我正在我的 SpriteKit 游戏(iOS 8 + Swift)中集成社交分享。一切正常,但我收到以下错误:“LaunchServices:invalidationHandler called”。知道如何解决错误吗?这是我的代码:
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