         }
     }
     
+    /// Tracks wether an alert is in the process of being transitioned in / out:
+    /// - if true we defer other animations until after the transition has finished using the `setVisibleAnimationCompletion`
+    private var setVisibleAnimationInProgress: Bool = false
+    private var setVisibleAnimationCompletion: (() -> Void)? = nil
+    
     /**
      *  Initialize with a title and / or message
      *

            let damping = alertStyler.animation.damping
            let initVel = isVisible ? 0 : alertStyler.animation.initialVelocity
            
            UIView.animate(withDuration: duration, delay: 0, usingSpringWithDamping: damping, initialSpringVelocity: initVel, options: [], animations: bounceAnimation, completion: { (complete) in
                if complete {
                    completion?()
                }
            })
            

    }
    
    @objc func keyboardWillHide(notif: Notification) {
        func keyboardWillHideAnimation(completion: ((Bool) -> Void)? = nil) {
            self.alertViewYContraint?.constant = 0
            
            UIView.animate(withDuration: TimeInterval(0.1), animations: { [weak self] in
                guard let strongSelf = self else { return }
                strongSelf.view.layoutIfNeeded()
            }, completion: completion)
        }
        
        if setVisibleAnimationInProgress {
            setVisibleAnimationCompletion = { [weak self] in
                keyboardWillHideAnimation(completion: { (complete) in
                    guard complete else { return }
                    
                    self?.setVisibleAnimationCompletion = nil
                })
            }
        }
        else {
            keyboardWillHideAnimation()
        }
    }
}

