Here is the related code where I get the crash:
protocol MixedItemsPerRowFlowLayoutDelegate: NSObjectProtocol {
typealias TileType = SelfSizingCellProtocol & CellConfigurable
func tileAtIndexPath(_ indexPath: IndexPath) -> TileType?
func estimatedItemsPerRow() -> Int
}
class MixedItemsPerRowFlowLayout {
weak var flowLayoutDelegate: MixedItemsPerRowFlowLayoutDelegate?
func itemWidth(atIndexPath indexPath: IndexPath?) -> CGFloat {
if let delegate = self.flowLayoutDelegate, let indexPath = indexPath, let tile = delegate.tileAtIndexPath(indexPath) {
.....
}
}
}
This is a UICollectionViewLayout subclass. The MixedItemsPerRowFlowLayoutDelegate is a ViewController. The crash happens on the tileAtIndexPath
call: protocol witness for MixedItemsPerRowFlowLayoutDelegate.tileAtIndexPath(_:). in conformance ViewController. Any ideas on what's going on? Unfortunately we're unable to reproduce, but see a bunch of instances in our crash logs.