Created
October 27, 2018 14:24
-
-
Save marcos1262/606f4c21c455e3f16f33318b3792cb70 to your computer and use it in GitHub Desktop.
Share some text through the OS
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
func share(_ text: String) { | |
let activityVC = UIActivityViewController(activityItems: [text], applicationActivities: nil) | |
activityVC.excludedActivityTypes = [UIActivity.ActivityType.airDrop, | |
UIActivity.ActivityType.addToReadingList] | |
self.present(activityVC, animated: true, completion: nil) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment