Created
December 3, 2020 06:40
-
-
Save cpageler93/7c1ab137130f0dc2960bf35993f5ed12 to your computer and use it in GitHub Desktop.
@tizba I unfortunately no longer have an executable app that contains the code. Those were my first steps with SwiftUI on macOS back then. I rewrote the whole app in AppKit, because SwiftUI was not that powerful as it is now.
In old git commits I found this code:
var body: some View {
NavigationView {
VStack {
List {
Section(header: Text("Languages")) {
ForEach(document.languages) { language in
...
}
}
}
...
}
.listStyle(SidebarListStyle())
.frame(minWidth: 220)
.toolbar {
ToolbarItemGroup {
Button(action: toggleSidebar, label: {
Image(systemName: "sidebar.left")
})
// Spacer()
// Button(action: {}, label: {
// Text("Button")
// })
}
}
EmptyView()
}
}
I can't promise you that the code still runs today and produces the right result. Good luck!
unfortunately it only for lastest macos. ah
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, on which view do you apply the .toolbar modifier so that the buttons are shown in the sidebar rather than next to "Untitled" ?
Thanks in advance.