     
     fileprivate var startingPoint = CGPoint(x: 0, y: 0)
     fileprivate var currentPoint = CGPoint(x: 0, y: 0)
+    fileprivate var lastPoint = CGPoint(x: 0, y: 0)
     fileprivate var deltaY: CGFloat = 0.0
+    fileprivate var lastDeltaY: CGFloat = 0.0
+    fileprivate var factor: CGFloat = 0.0
     
     fileprivate var ovalLine: CAShapeLayer!
     fileprivate var smileyLine: CAShapeLayer!

        return path.cgPath
    }
    
    fileprivate func drawSmileyPath() -> CGPath {
        let path = UIBezierPath()
        path.move(to: CGPoint(x: contentView.frame.width*0.25, y: contentView.frame.height*0.75))
        path.addLine(to: CGPoint(x: contentView.frame.width*0.75, y: contentView.frame.height*0.75))
        return path.cgPath
    }
}

        switch regonizer.state {
        case .began:
            startingPoint = regonizer.translation(in: self)
            print("began : \(startingPoint) \(currentPoint) \(lastDeltaY)")
        case .changed:
            currentPoint = regonizer.translation(in: self)
            deltaY = currentPoint.y - startingPoint.y
//            print("deltaY : \(deltaY)")
            

            smileyLine.path = drawSmileyPath(from: deltaY)
            
            
            
        case .cancelled, .ended:
            lastPoint = regonizer.translation(in: self)
            
//            let delta = currentPoint.y - startingPoint.y
            lastDeltaY = max(-45, min(45, deltaY))
            
            print("cancelled \(lastDeltaY)")
            hide()
        default:
            return
        }
