How to implement and use search textfield inside NSMenu?

Viewed 162

As shown in the screenshot below Google Chrome most likely has NSMenu in help and the first item in this NSMenu is the Search text field, which allows searching for different options.

If I want to implement the same using SwiftUI or Appkit+Swift, how would I go about it?

enter image description here

What I did so far?

Appkit+Swift approach:

I can use NSMenu to construct the menu item and add NSTextField for search purposes. But I am lost after that and not able to find the good example of such approach further.

SwiftUI approach:

No idea here and any input is appreciated.

0 Answers
Related