我正在使用的代码准备了一个屏幕截图,并打开了包含屏幕截图的共享窗口。但是,setInitialText似乎不起作用。至少我输入的内容都没有出现。根没有声明它已被折旧。
let screen = UIScreen.mainScreen()
if let window = UIApplication.sharedApplication().keyWindow {
UIGraphicsBeginImageContextWithOptions(screen.bounds.size, false, 0);
window.drawViewHierarchyInRect(window.bounds, afterScreenUpdates: false)
let image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
let composeSheet = SLComposeViewController(forServiceType: SLServiceTypeFacebook)
composeSheet.setInitialText("I just hit \(highscore) on Reflext Test! Can you beat me?")
composeSheet.addImage(image)
presentViewController(composeSheet, animated: true, completion: nil)
}
答案 0 :(得分:2)
问题是现在Facebook不允许发布/共享预填充文本。此链接将为您提供有关Facebook预填充文本策略的信息。 https://developers.facebook.com/docs/apps/review/prefill