I m using FSCalendar in my app,i want to show next-previous buttons in that calendar so that user can be able to tap them as well. Tried hard but not getting any idea.
try this code
@IBOutlet weak var calendar: FSCalendar!
....
@IBAction func nextTapped(_ sender:UIButton) {
calendar.setCurrentPage(getNextMonth(date: calendar.currentPage), animated: true)
}
@IBAction func previousTapped(_ sender:UIButton) {
calendar.setCurrentPage(getPreviousMonth(date: calendar.currentPage), animated: true)
}
func getNextMonth(date:Date)->Date {
return Calendar.current.date(byAdding: .month, value: 1, to:date)!
}
func getPreviousMonth(date:Date)->Date {
return Calendar.current.date(byAdding: .month, value: -1, to:date)!
}
output