daily pastebin goal
26%
SHARE
TWEET

Untitled

a guest Feb 14th, 2018 69 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  1. for ind in 0...countNum
  2.             {
  3.                 guard let fireDate = alarm.fireDate else { return }
  4.                 print(fireDate)
  5.                 let date = fireDate.addingTimeInterval((1.0*Double(ind)) * 60.0)
  6.                 print(date)
  7.                 let weekday = Calendar.current.component(.weekday, from: Date())
  8.                 print(weekday)
  9.  
  10.                 let triggerDate = Calendar.current.dateComponents([.year, .month, .weekday, .hour, .minute, .second], from: date)
  11.                 DispatchQueue.main.async
  12.                     {
  13.                         print(triggerDate)
  14.                         let trigger = UNCalendarNotificationTrigger(dateMatching: triggerDate, repeats: true)
  15.                         let request = UNNotificationRequest(identifier: "(alarm.uuid)(ind)", content: notificationContent, trigger: trigger)
  16.                         UNUserNotificationCenter.current().add(request)
  17.                         {
  18.                             (error) in
  19.                             if let error = error
  20.                             {
  21.                                 print("Unable to add notification request, (error.localizedDescription)")
  22.                             }
  23.                         }
  24.                     }
  25.  
  26.             }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top