I was using this to hide the keyboard when tapped on screen (in the SwiftUI view), looks like the gesture recogniser for this was causing the issue. Once removed the collectionView works correctly.
func hideKeyboardOnTap() -> some View {
return self.onTapGesture {
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
}
}
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: