我已经检查了 iOS 10 Home 应用程序。屏幕截图仅从家庭应用程序中捕获。
从过去 2 天开始,我一直在尝试实现 HMTimerTrigger 重复功能。我的要求是我必须在每个星期一、星期二和星期五重复触发。我发现我只能添加一天(周一或周二......但不能在周一和周二),如下所示。
unsigned flags = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitWeekOfYear | NSCalendarUnitDay | NSCalendarUnitHour | NSCalendarUnitMinute;
NSDate *fireDate = [NSDate date];
NSDateComponents *recurrenceComponents = [[NSDateComponents alloc] init];
recurrenceComponents.weekday = 2; // For monday
NSDateComponents *dateComponents = [[NSCalendar currentCalendar] components:flags fromDate:fireDate];
fireDate = [[NSCalendar currentCalendar] dateFromComponents:dateComponents];
HMTimerTrigger *trigger = [[HMTimerTrigger alloc] initWithName:triggerName.text
fireDate:fireDate
timeZone:nil
recurrence:recurrenceComponents
recurrenceCalendar:[NSCalendar currentCalendar]];
感谢您阅读我的帖子。任何想法/建议都会非常有帮助。