         }
         
         // Get the appropriate calendar.
-        let calendar = NSCalendar.current
+        let calendar = Calendar.current
         
         // Create the start date components.
         var oneDayAgoComponents = DateComponents()

                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 ?? "")
                    }
                }
            }


extension ViewController {
    fileprivate func fetchCalendars() {
        events.createCalendarForReminders(title: "El Salvador") { [weak self] (calendar, error) in
            print("Create Calendar", calendar ?? "", error ?? "")
            
