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

Crash on jump-to-today #130

Open
tothgy opened this issue Nov 20, 2020 · 1 comment
Open

Crash on jump-to-today #130

tothgy opened this issue Nov 20, 2020 · 1 comment

Comments

@tothgy
Copy link

tothgy commented Nov 20, 2020

Steps to reproduce:

  • In the example project add a new event in the AllDayViewModel dated the previous week, like:
    private let lastWeekDate = Date().add(component: .day, value: -8)
  • Add a jump-to-today function like this:
let now = Date()
self.calendarWeekView.updateWeekView(to: now)
self.calendarWeekView.updateFirstDayOfWeek(setDate: now, firstDayOfWeek: .Monday)
self.calendarWeekView.scrollWeekView(to: now)
  • Recompile and launch the example project
  • Set the calendar properties to show 7 days, first day of week to Monday
  • Scroll to the previous week
  • Execute the jump-to-today function

Observe the app crashes with:
Fatal error: LongPressEventCell and AllDayEvent should be casted: file JZCalendarWeekViewExample/LongPressWeekView.swift

as the getCurrentEvent(with indexPath: IndexPath) returns nil.

@pwhsueh
Copy link

pwhsueh commented Jul 23, 2022

I have the same issue when i complier using Xcode 13

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