From 2d2c1b88909923d02dc6142ae18ae93ae5e10400 Mon Sep 17 00:00:00 2001 From: Yannick Gagnon Date: Thu, 16 Jan 2025 08:35:23 -0500 Subject: [PATCH] Fix voice-over crash --- FSCalendar/FSCalendar.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/FSCalendar/FSCalendar.m b/FSCalendar/FSCalendar.m index d9c2781a..7d171b5b 100644 --- a/FSCalendar/FSCalendar.m +++ b/FSCalendar/FSCalendar.m @@ -658,6 +658,10 @@ - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoi } } + // Work-around : When voice over triggers a scroll, this current delegate is always called with a targetContentOffset of 0,0 + // which sends the calendar to the minimum date, 1970 and causes a crash + if (targetOffset == 0 ) { return; } + NSInteger sections = lrint(targetOffset/contentSize); NSDate *targetPage = nil; switch (_scope) {