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

Fix iOS 18 cell dequeue crash #167

Merged
merged 2 commits into from
Oct 24, 2024
Merged

Conversation

benjamin-su
Copy link
Contributor

A crash occurs on iOS when trying to call on dequeueReusableCell method when it isn't used for display.

This PR changes the method used to cellForItem(at:) instead to prevent crash. (Apple logs specifically mentions the improper use of dequeue)

While we are at it, the returned cell was passed to a non optional parameter, but all future uses of it was optional.
Turn the parameter to optional, and remove the assertFailure to make the application more resistant to crashes.

@aerych aerych self-requested a review October 24, 2024 17:37
Copy link
Collaborator

@aerych aerych left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heya @benjamin-su 👋
Changes LGTM. I did a quick smoke test of the example app as well and saw no issues.
Thanks for wrangling this!
:shipit:

@benjamin-su benjamin-su merged commit f0c5515 into main Oct 24, 2024
5 checks passed
@benjamin-su benjamin-su deleted the Fix-iOS18-CellDequeue-Crash branch October 24, 2024 18:49
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

Successfully merging this pull request may close these issues.

2 participants