Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extension of CalendarViewController: JTAppleCalendarViewDataSource, JTAppleCalendarViewDelegate #570

Closed
nikpocuca opened this issue Sep 19, 2017 · 1 comment

Comments

@nikpocuca
Copy link

nikpocuca commented Sep 19, 2017

Hi ,

It is asking me to provide another function, I've been following your video tutorial but you only have two protocols outlined in the video. I cloned your project and implemented everything correctly. Could you resolve this issue?

Here is the code:

func calendar(_ calendar: JTAppleCalendarView, willDisplay cell: JTAppleCell, forItemAt date: Date, cellState: CellState, indexPath: IndexPath) { <#code#> }

I already have these two defined

` func calendar(_ calendar: JTAppleCalendarView, cellForItemAt date: Date, cellState: 
  CellState, indexPath: IndexPath) -> JTAppleCell {
 
    let cell = calendar.dequeueReusableJTAppleCell(withReuseIdentifier: "CustomCell", for: 
    indexPath) as! CustomCell
    
    cell.dateLabel.text = cellState.text
    
    return cell

}
func configureCalendar(_ calendar: JTAppleCalendarView) -> ConfigurationParameters {
    formatter.dateFormat = "yyyy MM dd"
    formatter.timeZone = Calendar.current.timeZone
    formatter.locale = Calendar.current.locale
    
    let startDate = formatter.date(from:"2017 01 01")
    let endDate = formatter.date(from: "2018 01 01")
    
    let parameters = ConfigurationParameters(startDate: startDate!, endDate: endDate!)
    return parameters
}

`
Why is it asking me to conform to another protocol?

Thanks

  • Nik
@patchthecode
Copy link
Owner

patchthecode commented Sep 19, 2017

You must be using the latest master branch code.
Yes, in the update to come, i will be forcing every one to implement the willDisplayCell function.
The reason is explained here -> #553

let me know if it was clear. I'll close this issue for now.
Will open again if you need more explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants