mmick66 / CalendarView

An Easy to Use Calendar for iOS (Swift 5.0)
MIT License
598 stars 115 forks source link

Always giving the error when trying to install by pod #116

Open devlove1C opened 4 years ago

devlove1C commented 4 years ago

`

    var today1 = Date()
    var tomorrowComponents = DateComponents()
    tomorrowComponents.day = 1
    let tomorrow = self.calendarView.calendar.date(byAdding: tomorrowComponents, to: today1)!
    self.calendarView.selectDate(tomorrow)

    #if KDCALENDAR_EVENT_MANAGER_ENABLED
    self.calendarView.loadEvents() { error in
        if error != nil {
            let message = "The karmadust calender could not load system events. It is possibly a problem with permissions"
            let alert = UIAlertController(title: "Events Loading Error", message: message, preferredStyle: .alert)
            alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: nil))
            self.present(alert, animated: true, completion: nil)
        }
    }
    #endif

    self.calendarView.setDisplayDate(today1)`

App crash on this line of code let tomorrow = self.calendarView.calendar.date(byAdding: tomorrowComponents, to: today1)!

xcode - 11.3.1 iOS - 12, 13 + Please let me know how to fix this issue