Skip to content

Instantly share code, notes, and snippets.

@anupamchugh
Created June 28, 2020 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anupamchugh/e49d20dc1602081024b41c1df755c0fd to your computer and use it in GitHub Desktop.
Save anupamchugh/e49d20dc1602081024b41c1df755c0fd to your computer and use it in GitHub Desktop.
let destruct = UIAction(title: "Destruct", attributes: .destructive) { _ in }
let items = UIMenu(title: "More", options: .displayInline, children: [
UIAction(title: "Item 1", image: UIImage(systemName: "mic"), handler: { _ in }),
UIAction(title: "Item 2", image: UIImage(systemName: "envelope"), handler: { _ in }),
UIAction(title: "Item 3", image: UIImage(systemName: "flame.fill"), handler: { _ in }),
UIAction(title: "Item 4", image: UIImage(systemName: "video"), state: .on, handler: { _ in })
])
button.menu = UIMenu(title: "", children: [items, destruct])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment