CNHomePageBaseNavigationController.swift 1.11 KB
//
//  CNHomePageBaseNavigationController.swift
//  metaCode
//
//  Created by zx on 2024/1/5.
//

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

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