Skip to content

Instantly share code, notes, and snippets.

@marcos1262
Created October 27, 2018 14:24
Show Gist options
  • Save marcos1262/606f4c21c455e3f16f33318b3792cb70 to your computer and use it in GitHub Desktop.
Save marcos1262/606f4c21c455e3f16f33318b3792cb70 to your computer and use it in GitHub Desktop.
Share some text through the OS
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