Search code examples
swiftfscalendar

How to Disable Specific Date in FSCalendar Libary Swift


i'm using FSCalendar library to make calendar on my app, but how to disable specific date in calendar.

for example if i have data 2017-04-30 30 April 2017 can't be selected.

Any idea how to make this?


Solution

  • You can use FSCalendar delegate method,

    func calendar(_ calendar: FSCalendar, shouldSelect date: Date, at monthPosition: FSCalendarMonthPosition) -> Bool
    {
        if(date == your date)
        {
            return false
        }
        else
        {
            return true
        }
    }