NotificationCenter registered selector is not called

后端 未结 1 1713
余生分开走
余生分开走 2020-12-22 12:22

I currently have this code below to see if the day has elapsed, but it doesn\'t seem to be working. Have I coded this correctly?

NotificationCenter.defaul         


        
相关标签:
1条回答
  • 2020-12-22 13:11

    I think the way you registered observer is not correct. Please try the below and check.

    NotificationCenter.default.addObserver(self, selector:#selector(self.calendarDayDidChange(notification:)), name:NSNotification.Name.NSCalendarDayChanged, object:nil)
    
    0 讨论(0)
提交回复
热议问题