Questions tagged [uidocument]

UIDocument represents a user-editable document in an iOS application. It is an abstract base class in the UIKit framework. When it is used, its subclass takes the role of the model of a model-view-controller application. Because it implements the NSFilePresenter protocol, it significantly simplifies writing a document-based iOS application. Its Mac OS counterpart is NSDocument.

UIDocument represents a user-editable document in an iOS () application. It is an abstract base class in the UIKit () framework. When it is used, its subclass takes the role of the model of a model-view-controller application. Because it implements the NSFilePresenter protocol, it significantly simplifies writing a document-based iOS application. Its Mac OS () counterpart is NSDocument ().

To learn more, see the Document-Based App Programming Guide for iOS.

268 questions
0
votes
1 answer

How to Register Font which was pick up from UIDocument

I'm trying to Register Font which was pick up from UIDocument, everything works fine I enabled Install Fonts capability under the Signing & Capabilities and I accessed the UIDocument file and I pick the font. but I don't know how to register…
Faris
  • 1,206
  • 1
  • 12
  • 18
0
votes
1 answer

Present Files document from URL

I am trying to find a way to present a document, file, image (anything that's within the iCloud Drive folder) to a user from the file's URL. Let's say that I present a document picker to the user with the regular UIDocumentPickerViewController and…
Ivan Cantarino
  • 3,058
  • 4
  • 34
  • 73
0
votes
1 answer

iCloud UIDocument opening fails after update on iOS 13

I have a simple UIDocument subclass with overriding load and contents functions. Before updating on iOS 13 json document was saved in url "/private/var/mobile/Library/Mobile…
Evgeny Karev
  • 605
  • 6
  • 13
0
votes
0 answers

The array of local storage is not updated instantly

I create a data manager model, here it is: public class DataManager { // get documents directiory static fileprivate func getDocumentDirectory() -> URL { if let url = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first…
David
  • 27
  • 4
0
votes
1 answer

Built-In Actions UIDocumentBrowserViewController

Is it possible to control which built-in actions appear in the UIDocumentBrowserActionAvailabilityMenu / UIDcoumentBrowserActionAvailabilityNavigationBar associated with a UIDocumentBrowserViewController? I'd like to convert my app's custom browser…
C. Outwin
  • 47
  • 1
  • 3
0
votes
1 answer

Why is the application package not always a package?

I have a swift app that is a viewer for a document type that is a package. The app exports the UTI for this type (I would prefer to import it, but that has the same problem). The app can open a package if the document is stored in iCloud, but not…
Randall
  • 725
  • 9
  • 27
0
votes
1 answer

Why NSFileManager doesn't work with UIDocumentBrowserViewController?

I need check files in directory exists and can be open, but my FileManager.default.fileExists(atPath: <#url_from_uidocumentbrowservc#>) return false. I can't get list of items in selected directory, I can't check my item exists or not. And one more…
0
votes
2 answers

iOS 11: How to get the location (File Provider) name of cloud-based file?

My iOS 11 app works with cloud-based files using UIDocumentPickerViewController (in .open mode). Once I have the URL, how can I get the name of the location (file provider) that stores the file? (such as "iCloud", "Dropbox", etc) My best guess was…
anmipo
  • 1
  • 2
0
votes
1 answer

UIDocument Opening to populate TableView

I am using a DocumentBrowserViewController in Swift to present documents to a ViewController. In the ViewController I have a tableView to present some of the data in the document. When the ViewController is presented, it wants to initialize the…
jz_
  • 338
  • 2
  • 14
0
votes
0 answers

UIDocument save error: Could not get attribute values

I see this error in Xcode debug console when I call save(...) on my UIDocument, but it seems to have no effect on my app. Anyone know what causes it and how to stop it? I'm saving documents as a package with FileWrapper. 2018-08-12…
Rob N
  • 15,024
  • 17
  • 92
  • 165
0
votes
1 answer

My CompletionHandler will not execute. Why?

I have the following code: document?.open { success in if success { print("file opened") self.consumed = self.document?.consumed } else { print("file read failure") } } As can be…
jz_
  • 338
  • 2
  • 14
0
votes
2 answers

Xamarin iOS DocumentPicker: How to import large files?

In the DidPickDocument event of UIDocumentPickerViewController I try to import/write the selected file into the app's local Documents directory. This works fine with "small" files (e.g < 100MB) using a subclassed UIDocument class with overriden …
fritz
  • 427
  • 1
  • 5
  • 13
0
votes
1 answer

How to import pdf files to table view cells using UIDocumentPicker

I am really stuck on how to import a pdf file and store it in a table view cell. I am using the UIDocumentPicker to import the pdf file but I am having trouble figuring out on how to store the pdf files data to a table view cell. My issue is that I…
Carlos27
  • 71
  • 5
0
votes
1 answer

How to open a text file with an iOS App from iOS File App (since iOS 11)?

I build an iOS App with Swift 4 and would like to import text files (CSV) from the iOS Files app (since iOS 11) into my app. Next step would be to parse the text into an a json, dictionary or array. It depends on the content. I just need read…
Moe
  • 43
  • 5
0
votes
1 answer

Document greyed out in document browser

I tried to build an app based on the Document based app template. I am trying to get it to open markdown files. I got it to create the files and show up in the share sheet when viewing the file in the Files app. However in the Document Browser in…
Hans
  • 2,354
  • 3
  • 25
  • 35