How to replace deprecated NSWeekCalendarUnit in context of UILocalNotification? How to replace deprecated NSWeekCalendarUnit in context of UILocalNotification? ios ios

How to replace deprecated NSWeekCalendarUnit in context of UILocalNotification?


If you were using NSWeekCalendarUnit to trigger a weekly reminder, replace it with NSCalendarUnitWeekOfYear:

if (days == 7) localNotif.repeatInterval = NSWeekCalendarUnit;        // deprecatedif (days == 7) localNotif.repeatInterval = NSCalendarUnitWeekOfYear;

You should find your weekly notification still works correctly.

Apple's documentation should be updated to provide guidance on the appropriate replacement.


matomo