Skip to content

Instantly share code, notes, and snippets.

@rtking1993
Created January 28, 2018 08:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rtking1993/3b6b1e7d5c7a1ca6aebd41dd163d1b87 to your computer and use it in GitHub Desktop.
Save rtking1993/3b6b1e7d5c7a1ca6aebd41dd163d1b87 to your computer and use it in GitHub Desktop.
Implementing ShareSheet
import UIKit
class ShareSheetViewController: UIViewController {
@IBOutlet var exampleLabel: UILabel!
@IBOutlet var exampleImageView: UIImageView!
let exampleURL = URL(string: "https://ios-cookbook.com/")
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
// MARK: IBAction Methods
@IBAction func present(sender: Any?) {
let object: Object = Object(text: exampleLabel.text, image: exampleImageView.image, url: exampleURL)
presentShareSheet(for: object)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment