     /// 自定义弹出和消失的转场动画
     func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
         
+        isPresent = true
+        
+        return self
+    }
+    
+    /// 自定义消失的转场动画
+    func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
+        
+        
+        isPresent = false
         return self
     }
     

        pop.transitioningDelegate = self 
 
        self.present(pop, animated: true, completion: nil)
    }
    
}


// MARK: - 自定义转场动画代理
extension HomeViewController : UIViewControllerTransitioningDelegate{
    
    /// 得到presentController，可可以修改对应的弹出view 的frame




// MARK: - 弹出动画和消失动画的代理

extension HomeViewController : UIViewControllerAnimatedTransitioning{
    
    
    /// 返回动画时间
    func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval{
       
        return 0.5
    }
    
    /// 获取“转场动画上下文”，可以通过上下文获取弹出的View额消失的view
