我有一个非常快速的初学者问题:我怎样才能让这个函数也共享一个 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)