Skip to content

Instantly share code, notes, and snippets.

@Dimillian
Created May 6, 2020 12:26
Show Gist options
  • Save Dimillian/9cac3e63de37ccf59cebeaf1feb6a6d1 to your computer and use it in GitHub Desktop.
Save Dimillian/9cac3e63de37ccf59cebeaf1feb6a6d1 to your computer and use it in GitHub Desktop.
struct ItemsListView: View {
private var sortButton: some View {
Button(action: {
self.showSortSheet.toggle()
}) {
Image(systemName: viewModel.sort == nil ? "arrow.up.arrow.down.circle" : "arrow.up.arrow.down.circle.fill")
.imageScale(.large)
}
}
private var layoutButton: some View {
Button(action: {
self.itemRowsDisplayMode = self.itemRowsDisplayMode == .compact ? .large : .compact
}) {
Image(systemName: itemRowsDisplayMode == .large ? "rectangle.grid.1x2" : "list.dash")
.imageScale(.large)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment