Closed sjmueller closed 3 years ago
Similar issue for me after upgrading to Xcode 13.0 and running the app on iOS 15:
the view returned from -collectionView:viewForSupplementaryElementOfKind:atIndexPath: does not match the element kind it is being used for. When asked for a view of element kind 'UICollectionElementKindSectionFooter' the data source dequeued a view registered for the element kind '7D3B1B07-7B46-449D-B7A2-E243CC0D9D98
In my case I was able to workaround the issue by adding the following:
.sectionFooter {
EmptyView()
}
what did you add it to?
I added it to one of the ASCollectionViewSection
s in my code. I only needed to add it to one, but that could be different for you.
Also (depending on the error message) you may need to add either an empty header or an empty footer.
Thanks for posting about this crash. It sounds like new behaviour on iOS 15 is enforcing that the same class of cell is always used for each supplementary type. Unfortunately I'm on holiday without a laptop so can't test but I think it will be a single line fix.
Thanks for posting about this crash. It sounds like new behaviour on iOS 15 is enforcing that the same class of cell is always used for each supplementary type. Unfortunately I'm on holiday without a laptop so can't test but I think it will be a single line fix.
As I said no computer to test, but replacing the supplementaryEmptyKind
with just kind
on line 87 here should hopefully fix that crash.
I cha
Thanks for posting about this crash. It sounds like new behaviour on iOS 15 is enforcing that the same class of cell is always used for each supplementary type. Unfortunately I'm on holiday without a laptop so can't test but I think it will be a single line fix.
As I said no computer to test, but replacing the
supplementaryEmptyKind
with justkind
on line 87 here should hopefully fix that crash.
I changed but I does not work. It says "Thread 1: "could not dequeue a view of kind: UICollectionElementKindSectionHeader with identifier 9DC51136-3548-42CA-9156-5FEDEFB485DA - must register a nib or a class for the identifier or connect a prototype cell in a storyboard"
Fixed: V2.1.1
Please let me know if this does not solve the issue for you, I tested multiple cases and could no longer reproduce any crash with the new version :)
Hello, How can I install version 2.1.1 of library with pod ? When I'm adding to pod 'ASCollectionView-SwiftUI' in my podfile. Library version still looking in 1.7.1.
Crash seems to have been fixed, but unknown insets appread on 15.0. You can check it in the official instafeed demo.
if #available(iOS 15.0, *) {
UITableView.appearance().sectionHeaderTopPadding = .leastNormalMagnitude
}
In iOS 15, a crash occurs in some circumstances when a
.sectionHeader
is not provided:and this particular code is hit:
This crash only occurs in iOS15, as the exact code does not crash in iOS14. More details can be found here:
https://developer.apple.com/forums/thread/682570
I was able to workaround the issue in my codebase by adding a dummy section header to each section:
I believe this is critical in nature because without action, many apps hitting this codepath will start crashing on September 20 when iOS 15 is made available to the general public.