Don_Mag icon

Untitled

Don_Mag | PRO | 06/27/22 03:20:28 PM UTC (Edited) | 0 ⭐ | 1384 👁️ | Never ⏰ | []
Swift |

570 B

|

None

|

0 👍

/

0 👎

    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)
            
        }
        
    }
 

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎