-
Notifications
You must be signed in to change notification settings - Fork 814
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
Type ViewController does not conform to protocol 'JTAppleCalendarViewDataSource' #58
Comments
Is the name of your view Controller called -> In your code, the viewController called |
Closing issue. It does not seem to be calendar related. |
You copied the code of the tutorial 1: https://patchthecode.github.io/MainTutorial/ I've got the same error when building. You need to add this method (copied from the iOS example available on GitHub) : func configureCalendar(_ calendar: JTAppleCalendarView) -> ConfigurationParameters {
let startDate = formatter.date(from: "2016 10 01")!
let endDate = formatter.date(from: "2016 12 01")!
let parameters = ConfigurationParameters(startDate: startDate,
endDate: endDate,
numberOfRows: numberOfRows,
calendar: testCalendar,
generateInDates: generateInDates,
generateOutDates: generateOutDates,
firstDayOfWeek: firstDayOfWeek)
return parameters
} |
@amrx06 i have now fixed the main tutorial. It was missing a |
Hello, I found the error, however, I did exactly same like you did in your tutorial. Did you change anything in your library code? extension ViewController: JTAppleCalendarViewDataSource, JTAppleCalendarViewDelegate{
func configureCalendar(_ calendar: JTAppleCalendarView) -> ConfigurationParameters {
formatter.dateFormat = "dd-mm-yyyy"
formatter.timeZone = Calendar.current.timeZone
formatter.locale = Calendar.current.locale
let startDate = formatter.date(from: "01-01-2000")!
let endDate = formatter.date(from: "31-12-2030")!
let parameters = ConfigurationParameters(startDate: startDate, endDate: endDate)
return parameters
}
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
}
|
@rayutsabdeep3 if you do not explain to me in detail your error, then i cannot help much.
|
@patchthecode Apologies. |
I'm having the same error when following the guide. Type 'ViewController' does not conform to protocol 'JTAppleCalendarViewDelegate' ---> it's missing the method:
I'm using the version 7.1.1 of Calendar - with swift 4.0 To be honest, i have no idea what to fill into this method, any advice or should i post a stack overflow question with this? Kind regards Chris |
The 2 major changes in version 7.1.1 Let me know if this explains it for you. Then fill in that function with the information found here -> #553 |
First of all, thank you so much for all the effort you put into this! Thanks! This solved it for me :) Kind regards Chris |
Awesome. cheers man 🍻 |
Hi, I got this error too. class CalendarioViewController: UIViewController
} extension CalendarioViewController: JTAppleCalendarViewDelegate, JTAppleCalendarViewDataSource
} Aaand now when I launch the App I'm getting this error |
@onvika Unknown class JTAppleCalendarView in Interface Builder file. |
I'm sure this isn't too tough of a fix. Around the section where you need to include the protocols to display the calendar I copy paste the extension and both its methods. My code looks like this:
I get the error that is in the title on the exact line of the extension. Any idea why that could be?
The text was updated successfully, but these errors were encountered: