 
 extension ViewController {
     @objc
-    func reminders(authorized reminders: Reminders) {
+    func eventsAuthorizedForReminders(events: Events) {
         print("Reminders access is authorized.")
         
         fetchCalendars()
     }
     
     @objc
-    func reminders(denied reminders: Reminders) {
+    func eventsDeniedForReminders(events: Events) {
         print("Reminders access is denied.")
     }
     
     @objc
-    func reminders(reminders: Reminders, status: RemindersAuthorizationStatus) {
+    func events(events: Events, status: EventsReminderAuthorizationStatus) {
         print("Reminders status:", remindersStatusToString(status))
     }
     
     @objc
-    func reminders(reminders: Reminders, createdCalendar calendar: EKCalendar?, error: Error?) {
+    func events(events: Events, createdCalendar calendar: EKCalendar?, error: Error?) {
         print("Reminders created calendar:", calendar ?? "", error ?? "")
     }
     
     @objc
-    func reminders(reminders: Reminders, removedCalendar calendar: EKCalendar, error: Error?) {
+    func events(events: Events, removedCalendar calendar: EKCalendar, error: Error?) {
         print("Reminders removed calendar:", calendar, error ?? "")
     }
     
     @objc
-    func reminders(reminders: Reminders, createdReminder reminder: EKReminder?, error: Error?) {
+    func events(events: Events, createdReminder reminder: EKReminder?, error: Error?) {
         print("Reminders created reminder:", reminder ?? "", error ?? "")
     }
     
     @objc
-    func reminders(reminders: Reminders, removedReminder reminder: EKReminder, error: Error?) {
+    func events(events: Events, removedReminder reminder: EKReminder, error: Error?) {
         print("Reminders removed reminder:", reminder, error ?? "")
     }
 }


extension ViewController {
    fileprivate func requestRemindersAuthorization() {
        reminders.requestAuthorization { (status) in
            print("Reminders request authorization:", remindersStatusToString(status))
        }
    }

//                print(calendar.title, calendar)
//            }
        
//            self?.fetchReminders(in: calendars)
//        }
        
        events.createCalendarForReminders(title: "El Salvador") { [weak self] (calendar, error) in
            print("Create Calendar", calendar ?? "", error ?? "")
            
            guard let c = calendar else {
                return
            }
            
            self?.events.createReminder(title: "Pick up #groceries", calendar: c, priority: .medium, notes: "Amazing!") { [weak self, c = c] (reminder, error) in
                print("Create Reminder:", reminder ?? "", error ?? "")
                
                guard let r = reminder else {
                    return
                }
                
                self?.events.removeReminder(identifier: r.calendarItemIdentifier) { [c = c] (success, error) in
                    guard success else {
                        print(error ?? "")
                        return
                    }
                    
                    self?.events.removeCalendar(identifier: c.calendarIdentifier) { (success, error) in
                        print("Calendar removed:", success, error ?? "")
                    }
                }
            }
        }
    }
    
    fileprivate func fetchReminders(in calendars: [EKCalendar]) {
        print("Fetch Reminders in lists.")

        events.fetchReminders(in: calendars) { (reminders) in
            for reminder in reminders {
                print("Reminder", reminder)
            }
