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

App Crash when Timezone is America/Mazatlan #1424

Open
ravalzankhan opened this issue Jan 25, 2024 · 5 comments
Open

App Crash when Timezone is America/Mazatlan #1424

ravalzankhan opened this issue Jan 25, 2024 · 5 comments

Comments

@ravalzankhan
Copy link

ravalzankhan commented Jan 25, 2024

I used pod version (2.8.4) in the iOS App and the app crashed when the Timezone is America/Mazatlan and got the below error. It happens on iOS 17 and above.

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Attempted to modify the selection of an out-of-bounds item (57) when there are only 42 items in section 647. Collection view: <FSCalendarCollectionView: 0x13f869e00; baseClass = UICollectionView; frame = (0 0; 0 0); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x1424f1090>; backgroundColor = UIExtendedGrayColorSpace 0 0; layer = <CALayer: 0x1424f0760>; contentOffset: {0, 0}; contentSize: {0, 0}; adjustedContentInset: {0, 0, 0, 0}; layout: <FSCalendarCollectionViewLayout: 0x1424efd80>; dataSource: <FSCalendar: 0x1424a7050; frame = (8 0; 398 300); clipsToBounds = YES; hidden = YES; autoresize = RM+BM; backgroundColor = UIExtendedGrayColorSpace 0 1; layer = <CALayer: 0x1403c3c20>>>.'
*** First throw call stack:
(0x19838979c 0x19095b6a8 0x197940dc0 0x19a6f17b0 0x19a6f05e8 0x19a6f0584 0x104ceb43c 0x104ceaac4 0x104ceaa48 0x102d03c98 0x102cee160 0x102cffa60 0x19a4f8830 0x19a4f846c 0x19a4d5a50 0x19a4d5354 0x19a4d4a44 0x19a4d49ac 0x19a3f9c28 0x1998607e0 0x19986036c 0x199866500 0x19985fae0 0x19985f794 0x1982d8ba0 0x1982d7654 0x1982d6cf4 0x1982d6824 0x1d6af29fc 0x19a5db7f0 0x19a5dae5c 0x19a7d96b0 0x102b33f10 0x102b33e88 0x102b55d54 0x1b8daf9c4)
libc++abi: terminating due to uncaught exception of type NSException

@ravalzankhan
Copy link
Author

ravalzankhan commented Jan 29, 2024

one more logs for this crash

  1. Assertion failure in -[FSCalendarCollectionView _validateSelectionOrHighlightIndexPath:isSelection:allowMassIndexPath:assertIfInvalid:], UICollectionView.m:8,265

  2. uses triple "arm64e-apple-ios17.3.0", which is not compatible with the target triple "arm64-apple-ios17.0.0". Enabling per-module Swift scratch context.

@zzdravkin
Copy link

Same problem I have, one way is to make default time zone for calendar, crash is gone but do not know if it's correct way, as all users will have one time zone.

class XYZFSCalendar: FSCalendar {
override init(frame: CGRect) {
super.init(frame: frame)
}

required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)

   if let projectTimeZone = TimeZone(identifier: "UTC") {
      self.setValue(projectTimeZone, forKey: "timeZone")
      self.perform(Selector(("invalidateDateTools")))
   }

}
}

@ravalzankhan
Copy link
Author

Same problem I have, one way is to make default time zone for calendar, crash is gone but do not know if it's correct way, as all users will have one time zone.

class XYZFSCalendar: FSCalendar { override init(frame: CGRect) { super.init(frame: frame) }

required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder)

   if let projectTimeZone = TimeZone(identifier: "UTC") {
      self.setValue(projectTimeZone, forKey: "timeZone")
      self.perform(Selector(("invalidateDateTools")))
   }

} }

Thanks, I tried this but it does not work in my case.
Even I downloaded the Fscalander demo App and it also crashed with the same case.

  1. Versions above 17 with TimeZone Mazatlan, Mexico.
  2. On Tap FsCalanderScope Example - It crash

I am not sure why it happens only on this timezone and OS 17, please give any solution if you have.

zzdravkin pushed a commit to zzdravkin/FSCalendar that referenced this issue Jan 30, 2024
time zone crashing for some swift new zones (example America/Mazatlan)

WenchaoD#1424
@zzdravkin
Copy link

New PR is created for #1425
you can test the changes on your project as is one line of code

@SergeyKovalenko
Copy link

#1423 (comment)

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

3 participants