与屏幕截图和文本共享URL

时间:2015-08-26 01:16:09

标签: xcode swift share xcode7-beta5

我有一个非常快速的初学者问题:我如何让这个功能共享一个URL?我总是遵循一切,并认为我做对了,但它似乎没有工作......非常感谢提前!

func takeSnapshot(view: UIView) {
    let bounds = UIScreen.mainScreen().bounds
    UIGraphicsBeginImageContextWithOptions(bounds.size, true, 0.0)
    self.view.drawViewHierarchyInRect(bounds, afterScreenUpdates: false)
    let image = UIGraphicsGetImageFromCurrentImageContext()
    UIGraphicsEndImageContext()
    let text = "Text to be shared... #Hashtag"
    let activityViewController = UIActivityViewController(activityItems: [image, text], applicationActivities: nil)
    self.presentViewController(activityViewController, animated: true, completion: nil)

1 个答案:

答案 0 :(得分:0)

只需添加Identity

即可
Application Pool