Repeating local notification daily at a set time with swift

前端 未结 4 1590
小鲜肉
小鲜肉 2020-11-29 03:58

I am new to iOS development, but have created the app and I am trying to create a daily notification for a set time. Currently the notification executes once for the given d

4条回答
  •  隐瞒了意图╮
    2020-11-29 04:44

    You have to provide an NSCalendarUnit value like “HourCalendarUnit” or “DayCalendarUnit” for repeating a notification.

    Just add this code to repeat the local notification daily :

    notification.repeatInterval = NSCalendarUnit.CalendarUnitDay
    

提交回复
热议问题