The following code isn't working (isn't activating calendarDayDidChange) when the date changes:
// Define identifier
let notificationName = Notification.Name("NSNotification.Name.NSCalendarDayChanged")
// Register to receive notification
NotificationCenter.default.addObserver(self, selector: #selector(calendarDayDidChange(notification:)), name: notificationName, object: nil)
The method header is
func calendarDayDidChange(notification : NSNotification)