Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer bounds contains NaN: [nan nan; nan nan]'
Crash is happening when loading Koloda view, on devices running iOS 10.3.2
private func layoutCard(_ card: DraggableCardView, at index: Int) {
if index == 0 {
card.layer.transform = CATransform3DIdentity
card.frame = frameForTopCard()
} else {
let cardParameters = backgroundCardParametersForFrame(frameForCard(at: index))
let scale = cardParameters.scale
card.layer.transform = CATransform3DScale(CATransform3DIdentity, scale.width, scale.height, 1.0)
card.frame = cardParameters.frame
}
}
The reason of the crash is trying to get the scale width and height, where they are NaN
For now i have added this condition before card layer transformation to check if height and width isNaN
if scale.height.isNaN || scale.width.isNaN {
return
}
Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer bounds contains NaN: [nan nan; nan nan]'
Crash is happening when loading Koloda view, on devices running iOS 10.3.2
The reason of the crash is trying to get the
scale
width and height, where they areNaN
For now i have added this condition before card layer transformation to check if height and width isNaN