Questions tagged [documentgroup]

19 questions
14
votes
3 answers

How to make a SwiftUI DocumentGroup app without starting on the file picker?

If a user uses the Document App template in Xcode to create a SwiftUI app, macOS starts them off with a new document. This is good. I can work with that to present onboarding UI within a new document. However, with that same app running on iOS, the…
MScottWaller
  • 3,321
  • 2
  • 24
  • 47
12
votes
2 answers

What is the difference between `FileDocument` and `ReferenceFileDocument` for `DocumentGroups` in SwiftUI?

I'm trying to setup a DocumentGroup in my app, but there's no examples out there yet ReferenceFileDocument is for. I know what a FileDocument is, but how are ReferenceFileDocuments different. In the docs all it says is: Conformance to…
Joshua Olson
  • 3,675
  • 3
  • 27
  • 30
8
votes
1 answer

Create and open a new document in SwiftUI DocumentGroup macOS

How can I open a new document window in a SwiftUI ReferenceFileDocument-based app? Background This macOS app programmatically opens WindowGroups using .handleEvents(:). Unfortunately, this results in a File/New menu that wraps the names of those…
Ryan
  • 1,252
  • 6
  • 15
8
votes
0 answers

Let user pick document type to create when using SwiftUI & DocumentGroup

My document-based app supports several different file types. It is currently written in SwiftUI using a UIDocumentBrowserViewController. I'm trying to convert to the new SwiftUI (v2) DocumentGroup paradigm in which you don't directly use a…
5
votes
1 answer

Is it possible to combine WindowGroup and DocumentGroup in a SwiftUI iOS app?

I am developing a SwiftUI iOS app which originally started out with A WindowGroup. In another view, I have decided that I need to present that view as a DocumentGroup scene to take advantage of all the features that come with it. I don't want the…
Heyman
  • 449
  • 4
  • 13
5
votes
3 answers

SwiftUI + DocumentGroup in iOS/iPadOS: how to rename the currently open document

My question is regarding SwiftUI's DocumentGroup: using a simple, template-based project in Xcode (using the new multi-platform, document-based app template), I can create new documents, edit them, etc. Also, "outside" the app, I can manipulate the…
Vitor Enes
  • 203
  • 2
  • 9
4
votes
0 answers

SwiftUI / iOS 14: How to restore last active document (state?) with document-based (DocumentGroup) app

I am working with Xcode's provided SwiftUI multi-platform, document-based app template. Everything so far has been "smooth sailing", if you will, however I have no been able to figure out something I though was "built in": If, for some OS management…
Vitor Enes
  • 203
  • 2
  • 9
3
votes
1 answer

Hide file extension in document based app - DocumentGroup & UIDocumentBrowser

I've been working on a document-based app for well over 12 months now. It's out on the store, and everything is going well so far except for something I have been unable to solve since iOS 13. The built-in file viewer shows all my apps files with…
3
votes
3 answers

Swift UI 2 DocumentGroup get navigation bar buttons actions

I'm using the new 'DocumentGroup' Scene for an iOS 14 (currently working on Beta) project and I really don't know how can I detect events in the navigation bar like pressing '<' or back (see screen)of the predefined Navigation bar of the…
Niels
  • 375
  • 5
  • 15
2
votes
0 answers

SwiftUI make transition with document-base image brower app how?

I just follow some example to build my first document-base app. The UTType is image.The code is below,this do work properly,but there is not transition when you select the image item. import SwiftUI import UniformTypeIdentifiers @main struct…
2
votes
0 answers

Is it possible to use DocumentGroup in a SwiftUI iOS app along side WindowsGroup?

I am developing an iOS app and want one separate view to manage document interaction. Is it possible to integrate DocumentGroup in my app that uses WindowGroup?
2
votes
1 answer

How to read large files using SwiftUI DocumentGroup without making a temporary copy?

I have made a SwiftUI DocumentApp that reads large media files but doesn't need to write them. In my document, I just want to store the file's URL, so that I can load it using e.g. AVAudioFile. I can't work out how to do this without creating a…
olilarkin
  • 460
  • 6
  • 17
1
vote
0 answers

Change default "Create Document" label in DocumentGroup

The SwiftUI DocumentGroup allows us to easily create a document-based application. I'm looking at customizing the DocumentGroup. How can we change the label "Create Document"? Am I overlooking a modifier? In my use-case the term "Document" is a bad…
Herman
  • 1,534
  • 10
  • 16
0
votes
0 answers

Can DocumentGroup open file that type of is package?

I am trying to open a xcloc file, the file is a folder and the type in macOS called package. However, I could not open it as the init(configuration: ReadConfiguration) throws never called. struct XliffFile: FileDocument { var xliff:XMLXliff …
Owen Zhao
  • 3,205
  • 1
  • 26
  • 43
0
votes
1 answer

How to connect Help menu in SwiftUI MacOS DocumentGroup app to application logic?

SwiftUI DocumentGroup apps provide standard menu items including Help. By default, when we run the app, and click Help / "MyApp help" we see "Help isn't available for MyApp". Here's the main app: import SwiftUI @main struct MyApp: App { var…
denise
  • 116
  • 8
1
2