SwiftUI Support

How to add a custom button to the Edit Menu on both iOS and iPadOS natively using SwiftUI.

I have seen many ways to implement custom button using UIKit but wondering how to use SwiftUI to achieve the same thing.

I have never seen any modifiers or Menus about this. I guest there is no way to do that.

Any idea about this? or is it a future update for SwiftUI ??

What Edit Menu?

This is the way I know:

UIMenuController.shared.menuItems = [UIMenuItem(title: "some_title" , action: #selector(some_function))]

however it is now deprecated and replaced with UIEditMenuInteraction which I have no idea how to implement with a UIViewRepresentable, if someone figures how I'll be happy to know.

I have filed feedback for this: FB11212680.

Thanks

SwiftUI Support
 
 
Q