Emoji List in NSPopover on macOS like Messages App

时光总嘲笑我的痴心妄想 提交于 2019-12-11 08:57:31

问题


I want to show an NSPopover in my Mac app that lists the emoji just like Apple's Messages app does like this:

All I can figure out so far is that I can show the character palette in my app using this:

NSApp.orderFrontCharacterPalette(nil)

But that shows the palette as a separate window like this:

Does anyone know how I can embed the character palette in an NSPopover and retrieve the selected emoji in my app (similar to how Apple does it in Messages)?


回答1:


Set your textView, textField, or any other view as the sender of NSApp.orderFrontCharacterPalette(_:).

NSApp.orderFrontCharacterPalette(self.textField)


来源:https://stackoverflow.com/questions/54138430/emoji-list-in-nspopover-on-macos-like-messages-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!