Can anyone help me diagnose this crash. It happens in the animation block on the layoutIfNeeded()
function call. Full function and. crash report attached.
private func showWarningView() {
DispatchQueue.main.async { [weak self] in
guard let strongSelf = self else { return }
if let safeAreaHeight = strongSelf.superview?.safeAreaLayoutGuide.layoutFrame.size.height {
let visibleBannerHeight: CGFloat = strongSelf.isBannerVisible ? strongSelf.bannerHeight : 0
let newConstraintConstant = (safeAreaHeight - strongSelf.externalBottomOffset - visibleBannerHeight) - strongSelf.warningBannerHeight
strongSelf.addInternalBottomOffset(with: strongSelf.warningBannerHeight)
strongSelf.warningViewTopConstraint.constant = newConstraintConstant
}
strongSelf.isWarningViewVisible = true
let showWarningView = UIViewPropertyAnimator(duration: 0.25, curve: .easeIn, animations: {
self?.layoutIfNeeded()
})
showWarningView.startAnimation()
}
}