1

I'm using the JT Apple calendar pod to display the calendar what i would like to do is to put two buttons ( previous and next to scroll fast than swiping left or right ) but i can't find a way to get the index path for the collection view

enter image description here

> func configureCalendar(_ calendar: JTAppleCalendarView) ->
> ConfigurationParameters
>     {
>         formatter.dateFormat = "yyyy MM dd"
>         formatter.timeZone = Calendar.current.timeZone
>         formatter.locale = Calendar.current.locale
>         let startDate = Date() //today
>        let endDate = Calendar.current.date(byAdding: .month, value:2, to: startDate)   let parameters = ConfigurationParameters(startDate:
> startDate, endDate: endDate!)
>         return parameters
>     }

I need to implement the nextButtonPressed to swipe right and the Previous Button but without passing the corresponding dates

1 Answers1

1

You do not have to find the index path for the collectionView.

just call these functions,

calendarView.scrollToSegment(.next)      // Scrolls to next
calendarView.scrollToSegment(.previous)  // Scrolls to previous
calendarView.scrollToSegment(.start)     // Scrolls to start of calendar
calendarView.scrollToSegment(.end)       // Scrolls to end of calendar
Just a coder
  • 15,480
  • 16
  • 85
  • 138
  • Hello the date starts from today and ends 2 months later for example September is the current date October and November are the 2 months after September. I don't want to reach December while pressing the Next button or August while pressing the Previous button –  Sep 23 '17 at 10:31
  • I do not understand. Can you create an issue on github? I will respond there. And please be very detailed about the issue to help me understand. – Just a coder Sep 23 '17 at 16:27