Post

Replies

Boosts

Views

Activity

Reply to How to use double/triple columns navigation style in SwiftUI document-based app?
I am struggling with the same issue. I have hidden the top-level navigation view to get to 90% of the design I want. But I don't know how to add a 'back' button to get back to the document selection view. I added a button in the LH pane ('close') and a @Binding to the top-level DocumentGroup. [Tap on 'close' and set the isDisplayed to false] but I cannot find a way to express to 'DocumentGroup' to return to the file picker. Any leads on a path forward?
Aug ’20
Reply to Beta 2 of SwiftUI DocumentGroup does not support complex file formats
I was wrong. It appears that it does, you just need to do it right. Document.init() is called on when the + is tapped. This allows you to set up the generic data structure. Then write() is called and you can alter the fileWrapper() to be a directory() and then add a child fileWrapper() for files within the directory. Then, to launch the DocumentEditor, a call is made to Document.ini(fileWrapper: FileWrapper, contentType: UTType) and this is passed to the DocumentEditor.  Once the Document is created correctly, the system works. Hope this helps someone else struggling with this sequence.
Jul ’20
Reply to Best way to show a sidebar in iPad SwiftUI document app?
I am also trying to accomplish the same thing. I have put the NavigationView in the DocumentGroup, but the header of the app is now TWO lines; one for the document group (with just a '<' tool and the filename) and a second header for the navigation sidebar and a tool over the texteditor (proxy for my real editor). I want to merge those two toolbars. Any ideas? import SwiftUI @main struct HawkMultiPlatformMockupApp: App {     var body: some Scene {         DocumentGroup(newDocument: HawkMultiPlatformMockupDocument()) { fileDocumentConfig in             NavigationView {                 OutlineView()                 ContentView(document: fileDocumentConfig.$document)             }         }     } } struct ContentView: View {     @Binding var document: HawkMultiPlatformMockupDocument     var body: some View {         TextEditor(text: $document.text)             .navigationTitle("Text Editor View")     } } struct OutlineView: View {     var body: some View {         List() {             Text("a")             Text("b")             Text("c")         }         .listStyle(SidebarListStyle())         .navigationTitle("Navigation")         .toolbar {             ToolbarItem(placement: .navigationBarTrailing) {                 Text("add")             }         }     } }
Jul ’20