                 })
             }
         } else if recognizer.state == .cancelled {
-            UIView.animate(withDuration: 1, animations: { 
+            UIView.animate(withDuration: 0, animations: {
                 self.popupView.center = self.backgroundView.center
             })
         }

        }
    }

    public func show(with completion:((AlertView) -> Swift.Void)?) {
        UIApplication.shared.keyWindow?.addSubview(self)
        alignToParent(with: 0)
        addSubview(backgroundView)


    func popupMoved(recognizer: UIPanGestureRecognizer) {
        let location = recognizer.location(in: backgroundView)
        UIView.animate(withDuration: 0, animations: {
            self.popupView.center = location
        })

        if recognizer.state == .ended {
            let location = recognizer.location(in: backgroundView)
            let origin = CGPoint(x: backgroundView.center.x - popupViewInitialFrame.size.width/2,
                                 y: backgroundView.center.y - popupViewInitialFrame.size.height/2)
            let velocity = recognizer.velocity(in: backgroundView)
            if !CGRect(origin: origin, size: popupViewInitialFrame.size).contains(location) ||
                (velocity.x > constants.activeVelocity || velocity.y > constants.activeVelocity) {
