Is there a SwiftUI equivalent to "showsMenuAsPrimaryAction" in UIKit?
Edit: iOS 14 Beta 3 introduces Menu
Menu("Options") {
Button("Option 1", action: actionOne)
Button("Option 2", action: actionTwo)
}
Is there a SwiftUI equivalent to "showsMenuAsPrimaryAction" in UIKit?
Edit: iOS 14 Beta 3 introduces Menu
Menu("Options") {
Button("Option 1", action: actionOne)
Button("Option 2", action: actionTwo)
}
No, there is nothing equivalent to UIMenu's showsMenuAsPrimaryAction in SwiftUI
You can display SwiftUI context menus with a long press, and there's no other SwiftUI UIMenu equivalent. You can use UIMenu inside the Context menu(https://www.raywenderlich.com/6328155-context-menus-tutorial-for-ios-getting-started).
Alternatively, you can present a List on button click that can simulate the UIMenu actions.