Mac 基础知识:如何打开通知中心中提到,可以创建带有文本输入字段的交互式警报:
例如,您可以直接从通知中回复聊天。
我该如何实现它?例如,我想要一个通知:
let notification = NSUserNotification.init()
notification.hasActionButton = true
notification.actionButtonTitle = "Agree"
notification.title = "Header"
notification.informativeText = "Text."
NSUserNotificationCenter.default.deliver(notification)