private func showWarningView() { DispatchQueue.main.async { [weak self] in guard let self = self else { return } var newConstant: CGFloat! if self.warningViewTopConstraint.constant == 0.0 { newConstant = 100.0 } else { newConstant = 0.0 } self.warningViewTopConstraint.constant = newConstant UIView.animate(withDuration: 0.25, delay: 0.0, options: .curveEaseIn, animations: { [weak self] in guard let self = self else { return } self.view.layoutIfNeeded() }, completion: nil) } }