Post

Replies

Boosts

Views

Activity

Reply to Automatic ToolbarItem placement hides the Add Button in XCode's App project template
I have this same problem in a macOS project. It seems if there are multiple items with .automatic placement, all but one are hidden. This seems to be either a bug or undocumented behavior. The documentation is highly unreliable. Some placement options like .navigationBarLeading and .navigationBarTrailing are stated to be available in macOS 11.0+ but the compiler produces an error ("'navigationBarLeading' is unavailable in macOS") when used. And using .principal placement usually has a runtime error and crashes. Any help out there?
Mar ’21
Reply to Any SwiftUI SplitView 3-pane examples for macOS?
Maybe this is better. Wrap View into a NavigationView. 		var body: some View { 				NavigationView { 						MasterPane() 						HSplitView { 								DetailPane() 								InspectorPane() 						} 				} 		} }
Jul ’20
Reply to Any SwiftUI SplitView 3-pane examples for macOS?
I'm attempting something similar. Here's something basic I've come up with. It seems you can put multiple Views in the HSplitView (maybe up to 10?). I think you're supposed to get a toggle button to expose the sidebar for free, but I only see in it iPadOS, not macOS. See Hacking with Swift "how-to-add-a-sidebar-for-ipados".     var body: some View {         VStack {             Text("Items")             List(0..<16, id: \.self) { i in                 Text("Item \(i)")             }             .listStyle(SidebarListStyle())             Spacer()         }         .frame( idealWidth: 250, maxWidth: 250, maxHeight: .infinity)     } } struct DetailPane: View {     var body: some View {         Text("Details")             .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center)     } } struct InspectorPane: View {     var body: some View {         VStack {             Text("Inspector")         }         .padding()         .frame( idealWidth: 250, maxWidth: 250, maxHeight: .infinity)     } } struct ContentView: View {     var body: some View {         HSplitView {             MasterPane()             DetailPane()             InspectorPane()         }     } }
Jul ’20