1

In UIKit there is a UIMenu.Option .displayInline to display submenus with separator. Is there a way to do this also in SwiftUI?

eja08
  • 4,600
  • 3
  • 13
  • 19

1 Answers1

1

You can create Menu separators with Divider.

Example:

struct ContentView: View {
    var body: some View {
        Menu("Hello world!") {
            Button("Item 1") {}

            Button("Item 2") {}

            Divider()

            Button("Item 3") {}

            Button("Item 4") {}
        }
    }
}

Result:

Result

George
  • 25,988
  • 10
  • 79
  • 133