Skip to content

Instantly share code, notes, and snippets.

@achernoprudov
Created July 27, 2021 12:15
Show Gist options
  • Save achernoprudov/fd796f54713d3b51ff919979e001b1f0 to your computer and use it in GitHub Desktop.
Save achernoprudov/fd796f54713d3b51ff919979e001b1f0 to your computer and use it in GitHub Desktop.
UIMenu {
UIAction(title: "Open", image: UIImage(systemName: "xmark.octagon")) { _ in
...
}
UIMenu(title: "Edit") {
if item.isHidden {
UIAction(title: "Show", image: UIImage(systemName: "eye")) { _ in
...
}
} else {
UIAction(title: "Hide", image: UIImage(systemName: "eye.slash")) { _ in
...
}
}
UIAction(title: "Delete", image: UIImage(systemName: "bin")) { _ in
...
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment