I am using collection view in a table view and it is working fine in iPhone 11 and below but it is crashing on iPhone 12 and above. I am using Swift 5 for iOS development. I am writing the crashing reason below.
Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer bounds contains NaN: [0 nan; 390 431.667]. Layer: <CALayer:0x6000011ad0e0; position = CGPoint (195 435.167); bounds = CGRect (0 2049.33; 390 431.667); delegate = <UITableView: 0x7fba3e0f5800; frame = (0 219.333; 390 431.667); clipsToBounds = YES; autoresize = RM+BM; gestureRecognizers = <NSArray: 0x600001908cc0>; layer = <CALayer: 0x6000011ad0e0>; contentOffset: {0, 2049.3333333333335}; contentSize: {390, 2483}; adjustedContentInset: {0, 0, 0, 0}; dataSource: <Sanskar.TBHomeVC: 0x7fba3d871400>>; sublayers = (<CALayer: 0x6000010534a0>, <CALayer: 0x60000104aec0>, <CALayer: 0x60000107a9e0>, <CALayer: 0x60000103e500>, <CALayer: 0x60000118d380>, <CALayer: 0x600001050420>, <CALayer: 0x60000118c260>, <CALayer: 0x60000118c2a0>, <CALayer: 0x60000105c7a0>, <CALayer: 0x600001183cc0>); masksToBounds = YES; allowsGroupOpacity = YES; backgroundColor = <CGColor 0x6000034240f0> [<CGColorSpace 0x60000337d2c0> (kCGColorSpaceICCBased; kCGColorSpaceModelMonochrome; Generic Gray Gamma 2.2 Profile; extended range)] ( 1 1 )>'
terminating with uncaught exception of type NSException
CoreSimulator 732.18.6 - Device: iPhone 12 (9535BCEB-14A0-4723-A37B-08C42D07593C) - Runtime: iOS 14.1 (18A8394) - DeviceType: iPhone 12
Kindly drag the attention towards my issue and do let me know how to solve it.
Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer bounds contains NaN: [0 nan; 390 431.667]. Layer: <CALayer:0x6000011ad0e0; position = CGPoint (195 435.167); bounds = CGRect (0 2049.33; 390 431.667); delegate = <UITableView: 0x7fba3e0f5800; frame = (0 219.333; 390 431.667); clipsToBounds = YES; autoresize = RM+BM; gestureRecognizers = <NSArray: 0x600001908cc0>; layer = <CALayer: 0x6000011ad0e0>; contentOffset: {0, 2049.3333333333335}; contentSize: {390, 2483}; adjustedContentInset: {0, 0, 0, 0}; dataSource: <Sanskar.TBHomeVC: 0x7fba3d871400>>; sublayers = (<CALayer: 0x6000010534a0>, <CALayer: 0x60000104aec0>, <CALayer: 0x60000107a9e0>, <CALayer: 0x60000103e500>, <CALayer: 0x60000118d380>, <CALayer: 0x600001050420>, <CALayer: 0x60000118c260>, <CALayer: 0x60000118c2a0>, <CALayer: 0x60000105c7a0>, <CALayer: 0x600001183cc0>); masksToBounds = YES; allowsGroupOpacity = YES; backgroundColor = <CGColor 0x6000034240f0> [<CGColorSpace 0x60000337d2c0> (kCGColorSpaceICCBased; kCGColorSpaceModelMonochrome; Generic Gray Gamma 2.2 Profile; extended range)] ( 1 1 )>'
terminating with uncaught exception of type NSException
CoreSimulator 732.18.6 - Device: iPhone 12 (9535BCEB-14A0-4723-A37B-08C42D07593C) - Runtime: iOS 14.1 (18A8394) - DeviceType: iPhone 12
Kindly drag the attention towards my issue and do let me know how to solve it.