             
             point = gesture.location(in: view)
             
+            if animatedView.frame.contains(point) {
+                shouldBeginInactiveOfAnimatedView = true
+            } else {
+                shouldBeginInactiveOfAnimatedView = false
+            }
+            
             let pauseTime = animatedView.layer.convertTime(CACurrentMediaTime(), from: nil)
             print("pause time: \(pauseTime)")
         case .changed:

        // Add pan ges ture to the animated view.
        let pan = UIPanGestureRecognizer(target: self, action: #selector(handlePanGesture(_:)))
        pan.delegate = self
        animatedView.addGestureRecognizer(pan)
        
        let tap = UITapGestureRecognizer(target: self, action: #selector(handleTagGesture(_:)))
        tap.delegate = self
        view.addGestureRecognizer(tap)
    }
    
    override func didReceiveMemoryWarning() {

    @objc
    private func handleTagGesture(_ genture: UITapGestureRecognizer) {
        _applyImmediateValueOfAnimatedView()
        print("State of tap gesture: \(genture.state.rawValue)")
    }
    
    @objc
    private func handleLongPressGesture(_ genture: UILongPressGestureRecognizer) {
        _applyImmediateValueOfAnimatedView()
        print("State of long press gesture: \(genture.state.rawValue)")
    }
    
    @objc
