Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
ShareSheet Extension
import UIKit
// Extension
extension UIViewController {
func presentShareSheet(for object: Object) {
guard let text = object.text,
let image = object.image,
let url = object.url else {
let activityViewController = UIActivityViewController(activityItems: [text, image, url], applicationActivities: [])
viewController.present(activityViewController, animated: true, completion: nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment