117 questions
0
votes
0
answers
52
views
How to rename an open document in a SwiftUI DocumentGroup app with custom navigation?
I'm building a document-based SwiftUI app following Apple's Building a Document-Based App with SwiftUI guide. The app uses DocumentGroup and stores documents in iCloud Drive.
Important context: We're ...
0
votes
1
answer
62
views
SwiftUI Document-Based App Issues: Files Don't Appear in "Recents" When Created
I'm experiencing an issue with a SwiftUI document-based app where document files are not appearing in the "Recents" tab or anywhere in the Files app when created from the "Recents" ...
0
votes
1
answer
118
views
SwiftUI DocumentGroup toolbar items disappear when renaming document or randomly on iOS
Let me update the Stack Overflow question to include this additional information:
SwiftUI DocumentGroup toolbar items disappear when renaming document or randomly
I'm experiencing an issue with ...
5
votes
0
answers
88
views
SwiftUI document based app navbar disappears
I'm developing a document-based app using SwiftUI's DocumentGroupLaunchScene and DocumentGroup, following Apple's official tutorial: Building a Document-Based App with SwiftUI: https://developer.apple....
1
vote
1
answer
97
views
DocumentData / DocumentGroup initializes new instance of @ObservedObject on each change of the documents data in swift
I'm trying to create a Document-Based App, where each new Document has an own instance of Session(), which should not be stored with the document data though:
DocumentGroup(newDocument: DocumentData())...
1
vote
1
answer
1k
views
Use of @StateObject in Document-based SwiftUI application: getting instances instead of references
I am trying to use a @Stateobject in my document as source of truth for the dataModel behind the document. However, it seems I am doing something wrong as I appear to get different instances for the ...
2
votes
0
answers
367
views
Store Drawings of PKCanvasView in file
I created a document based app with SwiftUI and a PKCanvasView.
Now I want to save the drawings of the PKCanvasView inside of the file.
How can I do this?
2
votes
1
answer
509
views
UIDocumentBrowser doesn’t work on iPads while works fine on a simulator [iOS, Swift]
I am learning about how to build a document-based app in iOS.
I followed Apple's official example (https://developer.apple.com/documentation/uikit/view_controllers/building_a_document_browser-...
3
votes
2
answers
767
views
Can Xcode Document-based app be set to always open in a new tab
I have an macOS xcode swiftui document-based app. I can see that if I, "view->show tab bar" in the app, I get multiple tabs for free. However, if I do a "file open ...", it ...
10
votes
1
answer
3k
views
In a SwiftUI Document App, how to save a document from within a function
The current version of Xcode (version 12.5.1) provides a template for a Document Based App for macOS providing the following document model:
struct MyDocument: FileDocument {
var text: String
...
7
votes
0
answers
411
views
Onboarding screen at launch of SwiftUI document-based app
Is there anyway at all, to show an onboarding screen at the launch of a SwiftUI document-based app, before the file picker screen appears?
What I can do now, is to show the onboarding screen AFTER ...
0
votes
1
answer
78
views
How to stop MacOS Document-based App from automatically loading cached file
On launching my app from Xcode, my document-based app automatically apparently tries to load a cached document from a previous launch. That document appears to be corrupted as the app crashes in ...
4
votes
0
answers
1k
views
How can I change the filename in a SwiftUI Document-based app?
I've been using the new template for a document-based SwiftUI app. While you get a lot of file-management "for free" in the new template, as it stands in the iOS version users have to back ...
0
votes
0
answers
256
views
Document based app using one single window
I have a document-based macOS application, which is a basic text editor. The default behavior is to create a new window for every opened document. But I want to only have one window displayed at a ...
1
vote
0
answers
422
views
Understanding Core Data in Document Based App
I'm creating a document based app, using swift / SwiftUI and core data for the first time. My approach for CRUDing works - but it doesn't seem to be "right" somehow. Maybe there is a more ...
1
vote
1
answer
830
views
How do I connect SwiftUI to a Document in a macOS Document-based app?
I’m trying to create a basic Document-Based SwiftUI app. However, the skeleton created by Xcode does not have any linkage between the document and the content view. Here is what I have inferred to be ...
0
votes
1
answer
2k
views
MongoDB Query from multiple models / schemas and return in one field
I am using Nodejs and MongoDB, mongoose and expressjs, creating a Blog API having users, articles, likes & comments schema. Below are schemas that I use.
const UsersSchema = new mongoose....
1
vote
1
answer
226
views
When Application quits, NSDocument's isDocumentEdited method always returns false
In a document-based application, any change in a document is signalled by a
[self updateChangeCount: NSChangeDone];
At any time, when debugging, the [document isEdited] returns TRUE, as far as the ...
0
votes
1
answer
1k
views
Opening multiple documents in a UIDocumentBrowserViewController based app
Apple's documentation is thin on the subject of UIDocumentBrowserViewController-based apps that want to support opening multiple documents simultaneously.
I'd like to enable this, so that the user ...
3
votes
1
answer
518
views
Do macOS Document-Based Apps Automatically Enable Collaboration?
I am looking to build a document-based app on macOS using Xcode and targeting macOS High Sierra.
Does NSDocument provide document collaboration similar to that of Pages? Apple's Document Based Apps ...
0
votes
2
answers
106
views
How can I properly prepare XML files for document-based database?
How can I move @attributes to the root of that element when converting XML to JSON in PHP?
The simplest way I found to convert my XML file is to json_encode. But I would like to get rid of the @...
0
votes
1
answer
114
views
Make custom document display correct "Kind" Attribute in macOS Finder instead of "DocumentType"
In a document-based app, I create files with a custom UTI and extension. I declare both of these in the target's Info>Document Types and Info>Exported UTIs panes, as captured in the image below.
I ...
1
vote
0
answers
106
views
Document not deallocated on window close?
I have a document-based application, and my NSDocument subclass and NSWindow subclass are not being deallocated when I close a window. Any idea how to fix this?
1
vote
1
answer
588
views
Disable Document-Based functionality on a Cocoa Application
I started a Document-Based project on XCode for a MacOS project. I realize now that i don't need this functionality and its potentially causing problems and delays in my progress.
Is there a way to ...
3
votes
0
answers
783
views
OSStatus error -4
I am creating document based app and I have strange problem - I can't open files which I saved. Each time I receive this error: "The document /name/ could not be opened". Here is output from NSError: ...