     func shouldCancelDragAction() -> Bool {
         return false
     }
+
+    // MARK: - --------------------手势事件--------------------
+    // MARK: 各种手势处理函数注释
+    
+    // MARK: - --------------------按钮事件--------------------
+    // MARK: 按钮点击函数注释
+    
+    // MARK: - --------------------代理方法--------------------
+
+    // MARK: Gesture Recognizer -
+    func paningGestureReceive(recoginzer: UIPanGestureRecognizer) {
+    
+        if (self.viewControllers.count <= 1 || !self.canDragBack) {
+            return;
+        }
+        
+        let touchPoint: CGPoint = recoginzer.locationInView(UIApplication.sharedApplication().keyWindow)
+        if (recoginzer.state == UIGestureRecognizerState.Began) {
+            self.view.userInteractionEnabled = false
+            self.isMoving = true
+            self.startTouch = touchPoint
+            self.addBackgroundMaskView()
+            
+        } else if (recoginzer.state == UIGestureRecognizerState.Ended) {
+            self.view.userInteractionEnabled = true
+            let velocityX: CGFloat = recoginzer.velocityInView(self.view).x
+            if (velocityX < 200) {
+                animateTime = 0.3;
+            } else {
+                animateTime = 0.2;
+            }
+            
+            if (touchPoint.x - startTouch!.x > self.view.frame.size.width/3) {
+                let x: CGFloat = self.view.frame.size.width
+                self.addShadowLayerIfNeed()
+                
+                
+                UIView.animateWithDuration(animateTime, animations: { () -> Void in
+                    self.moveViewWithX(x, isTransaction: false)
+
+                    }, completion: { (Bool) -> Void in
+                        var frame: CGRect = self.view.frame
+                        frame.origin.x = 0;
+                        self.view.frame = frame;
+                        
+                        self.dragAnimated = true;
+                        
+                        if (!self.shouldInvokeCTRootBackItem()) {
+                            self.popViewControllerAnimated(false)
+                            
+                        }
+                        
+                        self.dragAnimated = false;
+                        
+                        self.isMoving = false;
+                })
+                
+            } else {
+                self.restorePopAction()
+            }
+            return
+            
+        } else if (recoginzer.state == UIGestureRecognizerState.Cancelled) {
+            self.view.userInteractionEnabled = true;
+            self.restorePopAction()
+            return
+            
+        } else {
+            if (self.isMoving) {
+                if (touchPoint.x - startTouch!.x > (self.view.frame.size.width/6)) {
+                    if (self.shouldCancelDragAction()) {
+                        return
+                    }
+                }
+                
+                self.addShadowLayerIfNeed()
+                self.moveViewWithX(touchPoint.x - startTouch!.x, isTransaction: true)
+            }
+        }
+
+    }
     
     // MARK: - --------------------属性相关--------------------
     // MARK: 属性操作函数注释

        return img;
    }
    
    // MARK: - --------------------手势事件--------------------
    // MARK: 各种手势处理函数注释
    
    // MARK: - --------------------按钮事件--------------------
    // MARK: 按钮点击函数注释
    
    // MARK: - --------------------代理方法--------------------

    // MARK: Gesture Recognizer -
    func paningGestureReceive(recoginzer: UIPanGestureRecognizer) {
    
        if (self.viewControllers.count <= 1 || !self.canDragBack) {
            return;
        }
        
        let touchPoint: CGPoint = recoginzer.locationInView(UIApplication.sharedApplication().keyWindow)
        if (recoginzer.state == UIGestureRecognizerState.Began) {
            self.view.userInteractionEnabled = false
            self.isMoving = true
            self.startTouch = touchPoint
            self.addBackgroundMaskView()
            
        } else if (recoginzer.state == UIGestureRecognizerState.Ended) {
            self.view.userInteractionEnabled = true
            let velocityX: CGFloat = recoginzer.velocityInView(self.view).x
            if (velocityX < 200) {
                animateTime = 0.3;
            } else {
                animateTime = 0.2;
            }
            
            if (touchPoint.x - startTouch!.x > self.view.frame.size.width/3) {
                let x: CGFloat = self.view.frame.size.width
                self.addShadowLayerIfNeed()
                
                
                UIView.animateWithDuration(animateTime, animations: { () -> Void in
                    self.moveViewWithX(x, isTransaction: false)

                    }, completion: { (Bool) -> Void in
                        var frame: CGRect = self.view.frame
                        frame.origin.x = 0;
                        self.view.frame = frame;
                        
                        self.dragAnimated = true;
                        
                        if (!self.shouldInvokeCTRootBackItem()) {
                            self.popViewControllerAnimated(false)
                            
                        }
                        
                        self.dragAnimated = false;
                        
                        self.isMoving = false;
                })
                
            } else {
                self.restorePopAction()
            }
            return
            
        } else if (recoginzer.state == UIGestureRecognizerState.Cancelled) {
            self.view.userInteractionEnabled = true;
            self.restorePopAction()
            return
            
        } else {
            if (self.isMoving) {
                if (touchPoint.x - startTouch!.x > (self.view.frame.size.width/6)) {
                    if (self.shouldCancelDragAction()) {
                        return
                    }
                }
                
                self.addShadowLayerIfNeed()
                self.moveViewWithX(touchPoint.x - startTouch!.x, isTransaction: true)
            }
        }

    }
    

    func addBackgroundMaskView() {
        let frame: CGRect = self.view.bounds
        if (self.backgroundView == nil) {

        if (isTransaction) {
            CATransaction.commit()
        }
        
    }
    
    func shouldInvokeCTRootBackItem() -> Bool {
