ShareSheet Extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
// Extension | |
extension UIViewController { | |
func presentShareSheet(for object: Object) { | |
guard let text = object.text, | |
let image = object.image, | |
let url = object.url else { | |
return | |
} | |
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