リンクを共有するとリンクが表示されます。画像を共有すると、画像が表示されます。しかし、私は下のコードで両方をしたいときは、画像なしでリンクのみが表示されます。リンクとスクリーンショットのFacebook共有の問題
私は両方を行うことはできますか?
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)
let urlPath: String = "https://itunes.apple.com/us/app/reflex-test!-how-far-can-you/id1123340346?ls=1&mt=8"
let url: NSURL = NSURL(string: urlPath)!
composeSheet.addURL(url)
composeSheet.addImage(image)
presentViewController(composeSheet, animated: true, completion: nil)
}
}
}
:私は次のコードを使用してい
7
:付属の下のスクリーンショットをご覧ください。同時に私はリンクだけでなくイメージを共有することができます。 –
@AshishVermaこれは奇妙です... – james
私の答えを確認してください –