We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Michael T.82
10 years agoNew member | Level 1
UIDocumentPicker cache
I'm successfully using UIDocumentPicker and can download and open a file in iOS.
However, If I upload a changed file to the web (via pc) and then download it again into iOS it still finds the old v...
Michael T.82
10 years agoNew member | Level 1
This is the code I'm using ...
func importDatabase(view: UIViewController!, sender: AnyObject, activityIndicator: UIActivityIndicatorView) {
self.view = view
self.activityIndicator = activityIndicator
let importMenu = UIDocumentMenuViewController(documentTypes: ["com.michaeltissington.uti.awdb"], inMode: .Import)
importMenu.delegate = self
importMenu.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
importMenu.popoverPresentationController?.sourceView = view.view
view.presentViewController(importMenu, animated: true, completion: nil)
}
func documentMenuWasCancelled(documentMenu: UIDocumentMenuViewController) {
documentMenu.dismissViewControllerAnimated(true, completion: nil)
activityIndicator.stopAnimating()
}
func documentMenu(documentMenu: UIDocumentMenuViewController, didPickDocumentPicker documentPicker: UIDocumentPickerViewController) {
documentPicker.delegate = self
activityIndicator.startAnimating()
view.presentViewController(documentPicker, animated: true, completion: nil)
}
func documentPickerWasCancelled(controller: UIDocumentPickerViewController) {
activityIndicator.stopAnimating()
}
func documentPicker(controller: UIDocumentPickerViewController, didPickDocumentAtURL url: NSURL) {
mergeDatabase(url)
activityIndicator.stopAnimating()
let fileManager = NSFileManager.defaultManager()
try! fileManager.removeItemAtURL(url)
}
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!