To share a file URL between two instances of your app using UIActivityViewController, you will need to follow these steps:
let fileURL = URL(string: "file:///path/to/your/file")!
let activityViewController = UIActivityViewController(activityItems: [fileURL], applicationActivities: nil)
activityViewController.excludedActivityTypes = [.airDrop, .addToReadingList]
present(activityViewController, animated: true, completion: nil)
func application(_ application: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
// handle the file URL here
return true
}
By following these steps, you can share a file URL between two instances of your app using UIActivityViewController.
Asked: 2022-10-14 11:00:00 +0000
Seen: 8 times
Last updated: May 26 '22