How can i select dates programmatically and show on FSCalendar
If you want to select date then below method will be helpful, where calendar is outlet of FSCalendar.
calendar.select(calendar.today)
And if you want to select multiple dates then the best way would be to use event dots, and that can be possible through below delegate method of FSCalendar Data source,
func calendar(_ calendar: FSCalendar, numberOfEventsFor date: Date) -> Int
{
//number of dots you want to show
}
or if you really want to show dates selected, you can use below method smartly and returning different colours for dates that you want to select,
public func calendar(_ calendar: FSCalendar, appearance: FSCalendarAppearance, fillDefaultColorFor date: Date) -> UIColor?
{
if your date
{
//return the colour for your dates
}
else
{
//return default colour
}
}
Hope, this answer helps you.
Related videos on Youtube
slytrkmn
Updated on June 04, 2022Comments
-
slytrkmn almost 2 years
I used FSCalendar(https://github.com/WenchaoD/FSCalendar) in my project. If user click repeat button, the events repeats everyday. I want to show it on calendar which is in my application. How can I do it?
-
Surjeet Rajput about 7 yearsfirst read about Eventkit. you can check this link for tutorial-> raywenderlich.com/64513/cookbook-making-calendar-reminder.
-
slytrkmn about 7 yearsyou understand me wrong. I want my own reminder application with using FSCalendar.
-
-
slytrkmn about 7 yearsI dont want to give an notification, I want to show on calendar which is in my application. I use FSCalendar. github.com/WenchaoD/FSCalendar.
-
Surjeet Rajput about 7 yearsyour problem is how to display it in calendar...?
-
Surjeet Rajput about 7 yearsFSCalendar have a method calendar(calendar: FSCalendar, didSelectDate date: NSDate) on selection you can display it or you can simply do it using tableView.Display your reminder in tableview.
-
teja_D over 5 yearsMake sure you confirm FSCalendarDelegateAppearance :)
-
Bhanuteja over 4 yearsAnd if we want to deselect them, it will create problem