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

[iOS] Fixed a crash issue with CollectionView when configured with CollectionViewHandler2 on iOS 15 and iOS 16. #27051

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Tamilarasan-Paranthaman
Copy link
Contributor

Root Cause of the issue

  • On iOS versions 15 and 16, the NumberOfSections method is called immediately after the base.LoadView method is invoked. At this point, ItemsSource was not set, which caused a crash when accessing the details from ItemsSource.

Description of Change

  • To address this issue, I added a check to verify if ItemsSource is null before proceeding. On iOS 17 and later, this behavior works correctly as the method is no longer called prematurely. For compatibility with older iOS versions, the null check ensures the method returns 0 if ItemsSource is null, resolving the issue with CV2 on iOS 15 and 16

Issues Fixed

Fixes #26997

Tested the behaviour in the following platforms

  • iOS
  • Android
  • Windows
  • Mac

Tested Versions

iOS Version Did the App crash?
iOS 15.2
iOS 15.5
iOS 16.4
iOS 17.5
iOS 18.0
iOS 18.1

Screenshots

Note: The video attached below shows that this issue occurs only on iOS 15+ and 16+ versions.

iOS version Before Issue Fix After Issue Fix
iOS 15.2
Before-Fix.mov
After-Fix.mov
iOS 15.5
Before-15.5.mov
After-15.5.mov
iOS 16.4
Before-16.4.mov
After-16.4.mov
iOS 17.5
Before-17.5.mov
After-17.5.mov
iOS 18.1
Before-18.1.mov
After-18.1.mov

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Jan 10, 2025
Copy link
Contributor

Hey there @Tamilarasan-Paranthaman! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@karthikraja-arumugam karthikraja-arumugam added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Jan 10, 2025
@jsuarezruiz jsuarezruiz added the area-controls-collectionview CollectionView, CarouselView, IndicatorView label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView collectionview-cv2 community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[iOS 15] CollectionView with CollectionViewHandler2 configured, is crashing app on iOS 15 (15.2)
3 participants