Created
November 3, 2018 23:27
-
-
Save mazz/986a0b12b4a953ed3f505b7fa1e63dfb to your computer and use it in GitHub Desktop.
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
// setup sharing button and UIActivityViewController | |
// once the download finishes | |
downloadingViewModel.fileDownloadCompleteEvent.asObservable() | |
.observeOn(MainScheduler.instance) | |
.subscribe({ download in | |
self.fullDownloadButton.rx.tap | |
.bind { | |
// copy file to temp dir to rename it | |
if let localDownload = self.downloadingViewModel.fileDownload.value { | |
let activityViewController = UIActivityViewController(activityItems: [UIImage(named: "FWBCLogo")!, "Shared via the Faithful Word App: https://faithfulwordapp.com/", localDownload.localUrl], applicationActivities: nil) | |
activityViewController.excludedActivityTypes = [ | |
.addToReadingList, | |
.openInIBooks, | |
.print, | |
.saveToCameraRoll, | |
.postToWeibo, | |
.postToFlickr, | |
.postToVimeo, | |
.postToTencentWeibo] | |
self.present(activityViewController, animated: true, completion: {}) | |
} | |
} | |
}) | |
.disposed(by: bag) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment