0

UNTimeIntervalNotificationTrigger 또는 UNCalendarNotificationTriggerrepeat 매개 변수를 사용하여 예약 된 알림 (iOS 10)을 true 2 일 연속으로 구현하고 싶습니다. 나중에 나중에 알림을 업데이트하거나 삭제할 수 있습니다. 예를 들어 13 Nov 2017에 대한 알림을 예약 했으므로 오전에 17 Nov 2017에서 10AM으로 다시 보내고 15 Nov 2017 다음 2 일 (예 : 16 Nov 및)의 알림 일정을 변경하고 싶습니다.지정된 날짜의 일정 알림

대안이 무엇이며 어떻게 달성 될 수 있는지 제안 해주십시오.

+0

:

let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: true) 

는 예를 들어해야하는 사용자의 요구에 맞게 dateComponents를 만들려면 developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/SchedulingandHandlingLocalNotifications.html – Arrabidas92

+0

@ Arrabidas92 제안에 감사드립니다. –

답변

1

나는 당신이 그것에 대한 방아쇠를 사용할 수 있다고 생각합니다. HTTPS : // 내가 제안 할 수있는 가장 좋은 로컬 알림에 대해 여기 아펠 문서에 알아 보는 것입니다

// Matching specific minute and hour 
let unitFlags = Set<Calendar.Component>([.hour, .minute]) 
dateComponents = NSCalendar.current.dateComponents(unitFlags, from: givenDate) 

// Matching specific weekday, hour and minute 
let unitFlags = Set<Calendar.Component>([.weekday, .hour, .minute]) 
dateComponents = NSCalendar.current.dateComponents(unitFlags, from: givenDate) 

// Matching specific day, hour and minute 
let unitFlags = Set<Calendar.Component>([.day, .hour, .minute]) 
dateComponents = NSCalendar.current.dateComponents(unitFlags, from: givenDate)