CNSlideBaseNavigationController.swift 1.11 KB
//
//  CNSlideBaseNavigationController.swift
//  metaCode
//
//  Created by zx on 2023/10/26.
//

import Foundation

class CNSlideBaseNavigationController: UINavigationController
    ,UIViewControllerTransitioningDelegate {
    var dismissClosure: (()->())?
    override func viewDidLoad() {
        super.viewDidLoad()
        modalPresentationStyle = .custom
        transitioningDelegate = self
    }

    func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
        return CNUpSlideAnimationTransition(animationType: .present)
    }
    
    func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
        return CNUpSlideAnimationTransition(animationType:  .dismiss)
    }
    
    func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? {
        return CNUpSlideCardPresentationController(presentedViewController: presented, presenting: presenting)
    }
}