FSCalendar
FSCalendar copied to clipboard
Could not cast value of type 'FSCalendarCell' to 'DIYCalendarCell'
Hi I had hard to the create a custom cell. I followed the example code DIYCalendarCell and basically no any changes. Just add new file that subclass to FSCalendarCell and then paste the code in the DIYCalendarCell and then register the custom cell to the calendar. However it crashes on the line
let diyCell = (cell as! CalendarDateCell)
it says "Could not cast value of type 'FSCalendarCell' to 'DIYCalendarCell' ", but the same code in the example project works properly.
I would appreciate if you can help me on this. Thank you
Xcode version is 8.3.3 FSCalendar version is the latest. Device: Simulator iPhone 7
The following informations are requested in a bug report
- A brief bug description.
- Stack trace.
- Integration method.
(manually/cocoapods/carthage)
- Full steps to reproduce.
- Device modal and iOS version.
e.g. iPhone 6s iOS9.1
- Xcode version.
e.g. Xcode 8.1
- FSCalendar version.
e.g. FSCalenda 2.5.1
- Does this happen in the demo project? Which one? Or a link to another demo project.
Hey @Tim77277 I've got the similar problem - did you manage to solve it?
same issue here.... Please who has figured this out...
incase you haven't figured this out yet, here is the solution, add this
func calendar(_ calendar: FSCalendar, cellFor date: Date, at position: FSCalendarMonthPosition) -> FSCalendarCell {
let cell = calendar.dequeueReusableCell(withIdentifier: "cell", for: date, at: position)
return cell
}
same issue.. Please give me any solutions ??
try to import FSCalendar in DIYCalendarCell.swift file than clean and build the project.It solves my error but now app crashes because of did not find identifier "Cell".
@pramod7 I'm getting the same issue while registering the cell