Update: Problem solved
First of all make sure your video available in your DocumentDirectory and than you can share it via URL of Directory like below.
Share Video with URL:
let url = self.documentDirectory().appendingPathComponent("yourFilename")
let share = UIActivityViewController(activityItems: [url], applicationActivities: nil)
share.popoverPresentationController?.sourceView = self.view
self.present(share, animated: true, completion: nil)
Get URL of DocumentDirectory:
func documentDirectory() - URL {
let documentsDirectory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!
return documentsDirectory
}
Topic:
Programming Languages
SubTopic:
Swift
Tags: