How to send a PDF file using UIActivityViewController

前端 未结 8 1092
野趣味
野趣味 2020-12-13 13:57

I\'m trying to send a PDF using a UIActivityViewController. So far everything works fine using a fairly basic approach but the one issue I have is that when I s

8条回答
  •  青春惊慌失措
    2020-12-13 14:32

    Swift 4.0

    Here I attached code.I just added thread handling in to present "activityViewController" because of this viewcontroller present before load actual data.

    let url = NSURLfileURL(withPath:fileName)
    
    let activityViewController = UIActivityViewController(activityItems: [url] , applicationActivities: nil)
    
    DispatchQueue.main.async {
                
        self.present(activityViewController, animated: true, completion: nil)
    }
    

提交回复
热议问题