Note this will crash in recent OSs (at least iOS12 and macOS Monterey, if not sooner). Use the delegate method instead (should only be necessary if you have a delegate already): See Apple docs for UNUserNotificationCenterDelegate
Topic:
UI Frameworks
SubTopic:
AppKit
Tags: