SwiftUI Emoji Picker - MacOS

Hello,

I am developing a multi-platform app, and I need an emoji picker. It should be the same as the emoji selection view in the Reminders App.

Reminders App Image:

(A button; when pressed calls the MacOS emoji selector, and the emoji selected is linked to a variable).

I know you can call the EmojiSelector with NSApp.orderFrontCharacterPalette($variable)

However, it only records the variable if you have a working text field linked to the variable. Then, if you edit the text field you can select more than 1 character, a non-emoji, and the emoji popover is not shown under the button.

How do I make an emoji selector like the one above. Does it require a textfield for the selected emoji to be linked to a variable.

If it does, can the text field be:

  1. Not Viewable and in a ZStack under the button
  2. Only editable by the emoji selector
  3. Replace the current emoji when another is selected

Sorry if my question is lengthy. I have everything else in my app ready, and want to release it to the app store (it will be free).

Thank you for any help,

Dev_Pro

SwiftUI Emoji Picker - MacOS
 
 
Q